Skip to content

Commit

Permalink
Fix color prop not working for Link (#4384)
Browse files Browse the repository at this point in the history
Co-authored-by: Liam Smith <[email protected]>
  • Loading branch information
joshwooding and liamsms authored Nov 11, 2024
1 parent 2eabe8b commit b395246
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-frogs-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/core": patch
---

Fixed `color="secondary"` not working for the Link component.
6 changes: 3 additions & 3 deletions packages/core/src/link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
href,
className,
children,
variant = "primary",
color = "primary",
color: colorProp,
variant,
target = "_self",
...rest
},
Expand All @@ -41,6 +41,7 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
});
const { ExternalIcon } = useIcon();

const color = variant ?? colorProp ?? "primary";
const LinkIconComponent =
IconComponent === undefined ? ExternalIcon : IconComponent;

Expand All @@ -51,7 +52,6 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
href={href}
ref={ref}
target={target}
variant={variant}
color={color}
{...rest}
>
Expand Down

0 comments on commit b395246

Please sign in to comment.