aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Buttons/Button
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-16 17:34:41 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-16 17:35:22 +0100
commit6e2a66ca0f12e11c66d993ed22624cd4659b5f2e (patch)
treef8434b2a49dacdb6d9c633d9fa1d3af4b9c298ec /src/components/Buttons/Button
parente1678d1116aa462ddd2bc70d10496e37b053433e (diff)
chore: define secondary button styles
I also rename submit style to primary.
Diffstat (limited to 'src/components/Buttons/Button')
-rw-r--r--src/components/Buttons/Button/Button.tsx31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/components/Buttons/Button/Button.tsx b/src/components/Buttons/Button/Button.tsx
new file mode 100644
index 0000000..c186d2a
--- /dev/null
+++ b/src/components/Buttons/Button/Button.tsx
@@ -0,0 +1,31 @@
+import { ReactNode } from 'react';
+import styles from '../Buttons.module.scss';
+
+const Button = ({
+ children,
+ clickHandler,
+ isDisabled = false,
+ isPrimary = false,
+}: {
+ children: ReactNode;
+ clickHandler: any;
+ isDisabled: boolean;
+ isPrimary?: boolean;
+}) => {
+ const classes = `${styles.btn} ${
+ isPrimary ? styles.primary : styles.secondary
+ }`;
+
+ return (
+ <button
+ className={classes}
+ type="button"
+ disabled={isDisabled}
+ onClick={clickHandler}
+ >
+ {children}
+ </button>
+ );
+};
+
+export default Button;