From b395246ad1c822473249018c910ed88cd9a3070a Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:13:30 +0000 Subject: [PATCH] Fix color prop not working for Link (#4384) Co-authored-by: Liam Smith --- .changeset/chilly-frogs-scream.md | 5 +++++ packages/core/src/link/Link.tsx | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/chilly-frogs-scream.md diff --git a/.changeset/chilly-frogs-scream.md b/.changeset/chilly-frogs-scream.md new file mode 100644 index 00000000000..c65f6a915b2 --- /dev/null +++ b/.changeset/chilly-frogs-scream.md @@ -0,0 +1,5 @@ +--- +"@salt-ds/core": patch +--- + +Fixed `color="secondary"` not working for the Link component. diff --git a/packages/core/src/link/Link.tsx b/packages/core/src/link/Link.tsx index 392a8120883..0a86426e100 100644 --- a/packages/core/src/link/Link.tsx +++ b/packages/core/src/link/Link.tsx @@ -26,8 +26,8 @@ export const Link = forwardRef(function Link( href, className, children, - variant = "primary", - color = "primary", + color: colorProp, + variant, target = "_self", ...rest }, @@ -41,6 +41,7 @@ export const Link = forwardRef(function Link( }); const { ExternalIcon } = useIcon(); + const color = variant ?? colorProp ?? "primary"; const LinkIconComponent = IconComponent === undefined ? ExternalIcon : IconComponent; @@ -51,7 +52,6 @@ export const Link = forwardRef(function Link( href={href} ref={ref} target={target} - variant={variant} color={color} {...rest} >