Tweak sign-in form

This commit is contained in:
Sam Becker 2023-10-23 09:47:39 -05:00
parent 95ac371212
commit 199ac4dea0
3 changed files with 6 additions and 5 deletions

View File

@ -40,6 +40,7 @@ export default function SignInForm() {
id="email"
inputRef={emailRef}
label="Admin Email"
type="email"
value={email}
onChange={setEmail}
readOnly={isSigningIn}

View File

@ -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<HTMLInputElement>
}) {
const { pending } = useFormStatus();

View File

@ -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);
}
}
}}