From 496ca55d10d9c37202fa87f7c1d9210ff45c5f81 Mon Sep 17 00:00:00 2001 From: Ruslan Lukoyanov <105169805+rLukoyanov@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:19:30 +0300 Subject: [PATCH] feat(link_underline): add link underline (#1648) Adds underline boolean type property for Link component --- src/components/Link/Link.scss | 4 ++++ src/components/Link/Link.tsx | 4 +++- src/components/Link/__stories__/Link.new.stories.tsx | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/Link/Link.scss b/src/components/Link/Link.scss index 618e92bbcd..e132a97940 100644 --- a/src/components/Link/Link.scss +++ b/src/components/Link/Link.scss @@ -42,4 +42,8 @@ $block: '.#{variables.$ns}link'; color: var(--g-color-text-link-visited-hover); } } + + &_underline { + text-decoration: underline; + } } diff --git a/src/components/Link/Link.tsx b/src/components/Link/Link.tsx index 2be2983f5a..3b693cae3c 100644 --- a/src/components/Link/Link.tsx +++ b/src/components/Link/Link.tsx @@ -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; @@ -31,6 +32,7 @@ export const Link = React.forwardRef(function Link { view = 'normal', visitable, + underline, href, target, rel, @@ -63,7 +65,7 @@ export const Link = React.forwardRef(function Link onBlur, id, style, - className: b({view, visitable}, className), + className: b({view, visitable, underline}, className), 'data-qa': qa, }; diff --git a/src/components/Link/__stories__/Link.new.stories.tsx b/src/components/Link/__stories__/Link.new.stories.tsx index cd6deaa11e..0640393b46 100644 --- a/src/components/Link/__stories__/Link.new.stories.tsx +++ b/src/components/Link/__stories__/Link.new.stories.tsx @@ -40,6 +40,9 @@ export default { id: { control: {type: 'text'}, }, + underline: { + control: {type: 'boolean'}, + }, }, parameters: { order: -100,