create ButtonLinkSecondary component

pull/26459/head^2
Paul Wackerow 2 years ago
parent 8016016c68
commit e9ca402279
No known key found for this signature in database
GPG Key ID: BB63E296FE9CAB8D
  1. 22
      src/components/UI/ButtonLinkSecondary.tsx
  2. 1
      src/components/UI/index.ts

@ -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>
);
};

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

Loading…
Cancel
Save