Complete link component

This commit is contained in:
Hazem Krimi
2021-04-14 17:08:39 +01:00
parent 3aa7eae0f3
commit 71f904e884
3 changed files with 191 additions and 5 deletions
+19 -2
View File
@@ -1,7 +1,24 @@
import { Link as RouterLink } from 'react-router-dom';
import { Wrapper } from './styles';
const Link = () => {
return <Wrapper></Wrapper>;
type LinkProps = {
href: string;
children?: React.ReactNode | JSX.Element | string;
color?: 'client' | 'productOwner' | 'developer' | 'admin' | string;
className?: string;
iconLeft?: React.SVGProps<SVGSVGElement>;
onClick?: () => void;
};
const Link = ({ href, children, iconLeft, ...props }: LinkProps) => {
return (
<Wrapper {...props}>
<RouterLink to={href}>
{iconLeft && <span className='icon left'>{iconLeft}</span>}
{children}
</RouterLink>
</Wrapper>
);
};
export default Link;