Tweak sign-in form
This commit is contained in:
parent
95ac371212
commit
199ac4dea0
@ -40,6 +40,7 @@ export default function SignInForm() {
|
|||||||
id="email"
|
id="email"
|
||||||
inputRef={emailRef}
|
inputRef={emailRef}
|
||||||
label="Admin Email"
|
label="Admin Email"
|
||||||
|
type="email"
|
||||||
value={email}
|
value={email}
|
||||||
onChange={setEmail}
|
onChange={setEmail}
|
||||||
readOnly={isSigningIn}
|
readOnly={isSigningIn}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export default function FieldSetWithStatus({
|
|||||||
loading?: boolean
|
loading?: boolean
|
||||||
required?: boolean
|
required?: boolean
|
||||||
readOnly?: boolean
|
readOnly?: boolean
|
||||||
type?: 'text' | 'password' | 'checkbox'
|
type?: 'text' | 'email' | 'password' | 'checkbox'
|
||||||
inputRef?: LegacyRef<HTMLInputElement>
|
inputRef?: LegacyRef<HTMLInputElement>
|
||||||
}) {
|
}) {
|
||||||
const { pending } = useFormStatus();
|
const { pending } = useFormStatus();
|
||||||
|
|||||||
@ -70,7 +70,10 @@ export default function ImageInput({
|
|||||||
const extension = file?.name.split('.').pop()?.toLowerCase();
|
const extension = file?.name.split('.').pop()?.toLowerCase();
|
||||||
const canvas = ref.current;
|
const canvas = ref.current;
|
||||||
if (file) {
|
if (file) {
|
||||||
if (maxSize && canvas) {
|
if (!(maxSize && canvas)) {
|
||||||
|
// No need to process
|
||||||
|
onBlobReady?.(file);
|
||||||
|
} else {
|
||||||
// Process images that need resizing
|
// Process images that need resizing
|
||||||
const image = await blobToImage(file);
|
const image = await blobToImage(file);
|
||||||
setImage(image);
|
setImage(image);
|
||||||
@ -108,9 +111,6 @@ export default function ImageInput({
|
|||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
quality,
|
quality,
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
// No need to process
|
|
||||||
onBlobReady?.(file);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user