Skip to content

Commit

Permalink
Bugfix to check _icon instead of icon so undefined icon doesn't show …
Browse files Browse the repository at this point in the history
…Spacer
  • Loading branch information
TimRoe committed Oct 31, 2024
1 parent a46d1b6 commit c83e2bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const Link: FC<LinkProps> = ({
lineHeight: 30,
}

let _icon: IconProps | 'no icon'
let _icon: IconProps

/** Function to massage Partial<IconProps> data into IconProps based on variant icon defaults */
const setIcon = (name?: IconProps['name']) => {
Expand Down Expand Up @@ -268,7 +268,7 @@ export const Link: FC<LinkProps> = ({
<ComponentWrapper>
<Pressable {...pressableProps} testID={testID}>
<Icon fill={linkColor} {..._icon} />
{icon === 'no icon' ? null : <Spacer size="2xs" horizontal />}
{_icon.noIcon ? null : <Spacer size="2xs" horizontal />}
<Text style={textStyle}>{text}</Text>
</Pressable>
</ComponentWrapper>
Expand Down

0 comments on commit c83e2bb

Please sign in to comment.