00a3c8ca2b
* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
28 lines
636 B
TypeScript
28 lines
636 B
TypeScript
import React from 'react';
|
|
import { Link as ReactLink } from 'react-router-dom';
|
|
import styled from '@emotion/styled';
|
|
|
|
type OwnProps = {
|
|
children: React.ReactNode;
|
|
href: string;
|
|
onClick?: () => void;
|
|
fullWidth?: boolean;
|
|
};
|
|
|
|
const StyledClickable = styled.div`
|
|
display: flex;
|
|
a {
|
|
color: ${({ theme }) => theme.font.color.tertiary};
|
|
font-size: ${({ theme }) => theme.font.size.sm};
|
|
text-decoration: underline;
|
|
}
|
|
`;
|
|
|
|
export const PrimaryLink = ({ href, children, onClick }: OwnProps) => (
|
|
<StyledClickable>
|
|
<ReactLink onClick={onClick} to={href}>
|
|
{children}
|
|
</ReactLink>
|
|
</StyledClickable>
|
|
);
|