From 1d399928ba610f6a96949b1c08ccef16504a4988 Mon Sep 17 00:00:00 2001 From: Cody Zuschlag Date: Wed, 26 Jul 2023 22:07:26 +0200 Subject: [PATCH] sign in test + sign standardize buttons --- src/components/DevSignIn.tsx | 15 +-- src/components/toolbar/Button.tsx | 13 ++- src/pages/SignIn.Test.tsx | 70 ++++++++++++++ src/pages/SignIn.tsx | 156 ++++++++++++++++-------------- 4 files changed, 170 insertions(+), 84 deletions(-) create mode 100644 src/pages/SignIn.Test.tsx diff --git a/src/components/DevSignIn.tsx b/src/components/DevSignIn.tsx index 0e5772e..8b0fdb0 100644 --- a/src/components/DevSignIn.tsx +++ b/src/components/DevSignIn.tsx @@ -1,15 +1,18 @@ import {signInWithEmailAndPassword} from 'firebase/auth'; import {auth} from '../firebase'; +import Button from './toolbar/Button'; export default function DevSignIn() { return ( -
+
This button only exists on emulator mode builds.
- + />
); } diff --git a/src/components/toolbar/Button.tsx b/src/components/toolbar/Button.tsx index 209e17d..e8c8442 100644 --- a/src/components/toolbar/Button.tsx +++ b/src/components/toolbar/Button.tsx @@ -9,19 +9,26 @@ export default function Button({ disabled, border, className, + submit, }: { - onClick: MouseEventHandler; + onClick?: MouseEventHandler; icon: string; label: string; title: string; disabled?: boolean; border?: boolean; className?: string; + submit?: boolean; }) { + const optionalProps: {onClick?: MouseEventHandler} = {}; + if (onClick !== undefined) { + optionalProps.onClick = onClick; + } + return ( - ) : ( - - )} - - {emailSent && ( -
- Please click on the link sent in the email. You can close this page. + + {isLink ? ( +
)} - {import.meta.env.MODE === 'emulator' && } -
+ ); }