create ButtonLinkSecondary component

This commit is contained in:
Paul Wackerow 2022-11-16 15:00:05 -08:00
parent 8016016c68
commit e9ca402279
No known key found for this signature in database
GPG Key ID: BB63E296FE9CAB8D
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import { Link, Stack, Text } from '@chakra-ui/react';
import NextLink, { LinkProps } from 'next/link';
import { Link as LinkTheme } from "../../theme/components"
interface Props extends LinkProps {
children: React.ReactNode;
}
export const ButtonLinkSecondary: React.FC<Props> = ({ href, children, ...restProps}) => {
const isExternal: boolean = href.toString().startsWith('http');
const variant = LinkTheme.variants["button-link-secondary"]
return (
<Stack sx={{ mt: '0 !important' }} {...variant}>
<NextLink href={href} passHref {...restProps}>
<Link variant='button-link-secondary' isExternal={isExternal}>
<Text textStyle='home-section-link-label'>{children}</Text>
</Link>
</NextLink>
</Stack>
);
};

View File

@ -1,2 +1,3 @@
export * from './ButtonLinkSecondary';
export * from './DataTable';
export * from './Header';