Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #246 from smartive-education/feature/navibutton-2
Browse files Browse the repository at this point in the history
fix: NaviButton
  • Loading branch information
tomschall authored Mar 14, 2023
2 parents 09fb8b8 + eb51506 commit d1d248e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const NaviButton = <
}: NaviButtonProps<T>) => {
const Icon = createIcon(icon);

return (
return !onClick ? (
<Link {...(props as any)} href={href}>
<StyledButton aria-label={label} onClick={onClick}>
{variant === 'default' && (
Expand All @@ -41,6 +41,16 @@ export const NaviButton = <
{variant === 'profile' && children}
</StyledButton>
</Link>
) : (
<StyledButton aria-label={label} onClick={onClick}>
{variant === 'default' && (
<>
<Icon />
<Span>{label}</Span>
</>
)}
{variant === 'profile' && children}
</StyledButton>
);
};

Expand Down

0 comments on commit d1d248e

Please sign in to comment.