Skip to content

Commit

Permalink
feat(link_underline): add link underline (#1648)
Browse files Browse the repository at this point in the history
Adds underline boolean type property for Link component
  • Loading branch information
rLukoyanov authored Jun 17, 2024
1 parent 4374858 commit 496ca55
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/Link/Link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ $block: '.#{variables.$ns}link';
color: var(--g-color-text-link-visited-hover);
}
}

&_underline {
text-decoration: underline;
}
}
4 changes: 3 additions & 1 deletion src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type LinkView = 'normal' | 'primary' | 'secondary';
export interface LinkProps extends DOMProps, QAProps {
view?: LinkView;
visitable?: boolean;
underline?: boolean;
title?: string;
href: string;
target?: string;
Expand All @@ -31,6 +32,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link
{
view = 'normal',
visitable,
underline,
href,
target,
rel,
Expand Down Expand Up @@ -63,7 +65,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link
onBlur,
id,
style,
className: b({view, visitable}, className),
className: b({view, visitable, underline}, className),
'data-qa': qa,
};

Expand Down
3 changes: 3 additions & 0 deletions src/components/Link/__stories__/Link.new.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export default {
id: {
control: {type: 'text'},
},
underline: {
control: {type: 'boolean'},
},
},
parameters: {
order: -100,
Expand Down

0 comments on commit 496ca55

Please sign in to comment.