Update link component

This commit is contained in:
Hazem Krimi
2021-05-06 01:43:53 +01:00
parent b53a1e82ae
commit a872cfa98f
2 changed files with 55 additions and 3 deletions
+9 -2
View File
@@ -15,14 +15,21 @@ type LinkProps = {
| 'black'
| 'white'
| string;
selected?: boolean;
className?: string;
iconLeft?: React.SVGProps<SVGSVGElement>;
onClick?: () => void;
};
const Link = ({ href, children, iconLeft, ...props }: LinkProps) => {
const Link = ({
href,
children,
iconLeft,
selected = false,
...props
}: LinkProps) => {
return (
<Wrapper {...props}>
<Wrapper {...props} selected={selected}>
<RouterLink to={href}>
{iconLeft && <span className='icon left'>{iconLeft}</span>}
{children}