diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-01-07 19:16:46 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-01-07 19:37:30 +0100 |
| commit | 1007c6689e7b549f48013d2c29eac9c78f13dfb7 (patch) | |
| tree | 832970f5e4443249f561d547e2c6864704712577 /src/components/Buttons/ButtonSubmit | |
| parent | 9a85c175bf59b7a360f09da23a3ac83293838570 (diff) | |
chore: improve search box and add button interactions on hover/focus
Diffstat (limited to 'src/components/Buttons/ButtonSubmit')
| -rw-r--r-- | src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx b/src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx index a2e493a..4725cad 100644 --- a/src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx +++ b/src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx @@ -1,8 +1,19 @@ +import { ReactNode } from 'react'; import styles from '../Buttons.module.scss'; -const ButtonSubmit: React.FunctionComponent = ({ children }) => { +type Modifier = 'search' | 'submit'; + +const ButtonSubmit = ({ + children, + modifier = 'submit', +}: { + children: ReactNode; + modifier?: Modifier; +}) => { + const withModifier = modifier === 'search' ? styles.search : styles.primary; + return ( - <button type="submit" className={`${styles.btn} ${styles.primary}`}> + <button type="submit" className={`${styles.btn} ${withModifier}`}> {children} </button> ); |
