From 1007c6689e7b549f48013d2c29eac9c78f13dfb7 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 7 Jan 2022 19:16:46 +0100
Subject: chore: improve search box and add button interactions on hover/focus

---
 src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src/components/Buttons/ButtonSubmit/ButtonSubmit.tsx')

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>
   );
-- 
cgit v1.2.3

