From 76c01d51ccbdd0faaf12b624328a40ef24f33f88 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 29 Dec 2021 17:01:42 +0100 Subject: chore: add a button-like component for links --- src/components/Buttons/ButtonLink/ButtonLink.tsx | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/components/Buttons/ButtonLink/ButtonLink.tsx (limited to 'src/components/Buttons/ButtonLink') diff --git a/src/components/Buttons/ButtonLink/ButtonLink.tsx b/src/components/Buttons/ButtonLink/ButtonLink.tsx new file mode 100644 index 0000000..70039a8 --- /dev/null +++ b/src/components/Buttons/ButtonLink/ButtonLink.tsx @@ -0,0 +1,30 @@ +import { ButtonPosition } from '@ts/types/app'; +import Link from 'next/link'; +import { ReactNode } from 'react'; +import styles from '../Buttons.module.scss'; + +const ButtonLink = ({ + children, + target, + position = 'left', + isExternal = false, +}: { + children: ReactNode; + target: string; + position?: ButtonPosition; + isExternal?: boolean; +}) => { + const classes = `${styles.btn} ${styles.link} ${styles[`link--${position}`]}`; + + return isExternal ? ( + + {children} + + ) : ( + + {children} + + ); +}; + +export default ButtonLink; -- cgit v1.2.3