From 199ac4dea0a2b128c7fa70f63e8392f65d2a0fce Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 23 Oct 2023 09:47:39 -0500 Subject: [PATCH] Tweak sign-in form --- src/auth/SignInForm.tsx | 1 + src/components/FieldSetWithStatus.tsx | 2 +- src/components/ImageInput.tsx | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/auth/SignInForm.tsx b/src/auth/SignInForm.tsx index 9ef0cc39..a8e717bd 100644 --- a/src/auth/SignInForm.tsx +++ b/src/auth/SignInForm.tsx @@ -40,6 +40,7 @@ export default function SignInForm() { id="email" inputRef={emailRef} label="Admin Email" + type="email" value={email} onChange={setEmail} readOnly={isSigningIn} diff --git a/src/components/FieldSetWithStatus.tsx b/src/components/FieldSetWithStatus.tsx index dcac825c..affe5150 100644 --- a/src/components/FieldSetWithStatus.tsx +++ b/src/components/FieldSetWithStatus.tsx @@ -27,7 +27,7 @@ export default function FieldSetWithStatus({ loading?: boolean required?: boolean readOnly?: boolean - type?: 'text' | 'password' | 'checkbox' + type?: 'text' | 'email' | 'password' | 'checkbox' inputRef?: LegacyRef }) { const { pending } = useFormStatus(); diff --git a/src/components/ImageInput.tsx b/src/components/ImageInput.tsx index b6637839..13320cb1 100644 --- a/src/components/ImageInput.tsx +++ b/src/components/ImageInput.tsx @@ -70,7 +70,10 @@ export default function ImageInput({ const extension = file?.name.split('.').pop()?.toLowerCase(); const canvas = ref.current; if (file) { - if (maxSize && canvas) { + if (!(maxSize && canvas)) { + // No need to process + onBlobReady?.(file); + } else { // Process images that need resizing const image = await blobToImage(file); setImage(image); @@ -108,9 +111,6 @@ export default function ImageInput({ 'image/jpeg', quality, ); - } else { - // No need to process - onBlobReady?.(file); } } }}