Tweak sign-in form
This commit is contained in:
parent
95ac371212
commit
199ac4dea0
@ -40,6 +40,7 @@ export default function SignInForm() {
|
||||
id="email"
|
||||
inputRef={emailRef}
|
||||
label="Admin Email"
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={setEmail}
|
||||
readOnly={isSigningIn}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user