diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-14 19:42:36 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-14 19:42:36 +0100 |
| commit | 16dbb4742264edac82fa6bb8e461259d097f4437 (patch) | |
| tree | 811571a48ed25ef04ed422504c593ec012e3b6f5 /src/components/Buttons/Button | |
| parent | 905b819d9a7b5a336989c6e7621e18b1d9daa531 (diff) | |
refactor(buttons): add a tertiary kind (previously links styles)
Diffstat (limited to 'src/components/Buttons/Button')
| -rw-r--r-- | src/components/Buttons/Button/Button.tsx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/components/Buttons/Button/Button.tsx b/src/components/Buttons/Button/Button.tsx index 4d26ea4..86e0e5b 100644 --- a/src/components/Buttons/Button/Button.tsx +++ b/src/components/Buttons/Button/Button.tsx @@ -1,26 +1,21 @@ -import { ButtonPosition } from '@ts/types/app'; +import { ButtonKind, ButtonPosition } from '@ts/types/app'; import { ReactNode } from 'react'; import styles from '../Buttons.module.scss'; const Button = ({ children, clickHandler, + kind = 'secondary', position = 'left', isDisabled = false, - isPrimary = false, }: { children: ReactNode; clickHandler: any; + kind?: ButtonKind; position?: ButtonPosition; isDisabled?: boolean; - isPrimary?: boolean; }) => { - const primaryPosition = `primary--${position}`; - const secondaryPosition = `secondary--${position}`; - const typeStyles = isPrimary - ? `${styles.primary} ${styles[primaryPosition]}` - : `${styles.secondary} ${styles[secondaryPosition]}`; - const classes = `${styles.btn} ${typeStyles}`; + const classes = `${styles.btn} ${styles[position]} ${styles[kind]}`; return ( <button |
