File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed
Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,18 @@ $block: '.#{$ns}link-block';
2222 }
2323
2424 & _has-arrow {
25+ display : inherit ;
26+ white-space : nowrap ;
27+
2528 & :hover ,
2629 & :active {
2730 --pc-text-header-color : inherit ;
2831 color : var (--yc-color-text-link );
2932 }
33+
34+ #{$root } __content {
35+ white-space : normal ;
36+ }
3037 }
3138
3239 & :hover {
@@ -44,8 +51,7 @@ $block: '.#{$ns}link-block';
4451
4552 & __arrow {
4653 position : relative ;
47- margin-left : 2px ;
48-
54+ top : 2px ;
4955 transition : transform 0.3s $ease-out-cubic ;
5056 transform : rotate (-90deg );
5157 }
@@ -57,6 +63,10 @@ $block: '.#{$ns}link-block';
5763
5864 & _m {
5965 @include text-size (body- 2);
66+
67+ #{$root } __arrow {
68+ top : 1px ;
69+ }
6070 }
6171
6272 & _s {
Original file line number Diff line number Diff line change 1- import React , { useContext } from 'react' ;
1+ import React , { Fragment , useContext } from 'react' ;
22import { Icon } from '@gravity-ui/uikit' ;
33
44import { block , getLinkProps , setUrlTld } from '../../utils' ;
@@ -13,6 +13,7 @@ import {useMetrika} from '../../hooks/useMetrika';
1313import './Link.scss' ;
1414
1515const b = block ( 'link-block' ) ;
16+ const WORD_JOINER_SYM = '\u200b' ;
1617
1718export type LinkFullProps = LinkProps & ClassNameProps ;
1819
@@ -23,9 +24,9 @@ function getArrowSize(size: TextSize) {
2324 case 'm' :
2425 return 18 ;
2526 case 's' :
26- return 12 ;
27+ return 14 ;
2728 default :
28- return 12 ;
29+ return 14 ;
2930 }
3031}
3132
@@ -79,13 +80,16 @@ const LinkBlock = (props: WithChildren<LinkFullProps>) => {
7980 onClick = { onClick }
8081 { ...linkProps }
8182 >
82- { children || text }
83+ < span className = { b ( 'content' ) } > { children || text } </ span >
8384 { arrow && (
84- < Icon
85- className = { b ( 'arrow' ) }
86- data = { Chevron }
87- size = { getArrowSize ( textSize ) }
88- />
85+ < Fragment >
86+ { WORD_JOINER_SYM }
87+ < Icon
88+ className = { b ( 'arrow' ) }
89+ data = { Chevron }
90+ size = { getArrowSize ( textSize ) }
91+ />
92+ </ Fragment >
8993 ) }
9094 </ a >
9195 ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ const WithChildrenTemplate: Story<LinkFullProps> = (args) => (
7575export const Default = DefaultTemplate . bind ( { } ) ;
7676export const ThemesSizes = ThemesSizesTemplate . bind ( { } ) ;
7777export const NormalWithChildren = WithChildrenTemplate . bind ( { } ) ;
78- export const NormalArrow = DefaultTemplate . bind ( { } ) ;
78+ export const NormalArrow = SizesTemplate . bind ( { } ) ;
7979export const NormalForDarkTheme = DarkTemplate . bind ( { } ) ;
8080export const UnderlineWithChildren = WithChildrenTemplate . bind ( { } ) ;
8181export const BackWithChildren = WithChildrenTemplate . bind ( { } ) ;
You can’t perform that action at this time.
0 commit comments