Add tests on top of ui/buttons, ui/links and ui/inputs (#342)
This commit is contained in:
29
front/src/modules/ui/components/links/PrimaryLink.tsx
Normal file
29
front/src/modules/ui/components/links/PrimaryLink.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
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.text40};
|
||||
font-size: ${({ theme }) => theme.fontSizeSmall};
|
||||
text-decoration: none;
|
||||
}
|
||||
`;
|
||||
|
||||
export function PrimaryLink({ href, children, onClick }: OwnProps) {
|
||||
return (
|
||||
<StyledClickable>
|
||||
<ReactLink onClick={onClick} to={href}>
|
||||
{children}
|
||||
</ReactLink>
|
||||
</StyledClickable>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user