chore: consolidate platform split checks
This commit is contained in:
@@ -11,15 +11,15 @@ export default function LoginModal({
|
||||
settings,
|
||||
onClose,
|
||||
onLogin,
|
||||
title = "Sign in",
|
||||
title = "i18n:govoplan-core.sign_in.ada2e9e9",
|
||||
message
|
||||
}: {
|
||||
settings: ApiSettings;
|
||||
onClose: () => void;
|
||||
onLogin: (response: LoginResponse) => void;
|
||||
title?: string;
|
||||
message?: string;
|
||||
}) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}: {settings: ApiSettings;onClose: () => void;onLogin: (response: LoginResponse) => void;title?: string;message?: string;}) {
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
@@ -46,23 +46,23 @@ export default function LoginModal({
|
||||
open
|
||||
title={title}
|
||||
onClose={onClose}
|
||||
footer={(
|
||||
<>
|
||||
<Button type="button" onClick={onClose}>Cancel</Button>
|
||||
<Button type="submit" form={formId} variant="primary" disabled={busy}>{busy ? "Signing in…" : "Sign in"}</Button>
|
||||
footer={
|
||||
<>
|
||||
<Button type="button" onClick={onClose}>i18n:govoplan-core.cancel.77dfd213</Button>
|
||||
<Button type="submit" form={formId} variant="primary" disabled={busy}>{busy ? "i18n:govoplan-core.signing_in.c66b2adc" : "i18n:govoplan-core.sign_in.ada2e9e9"}</Button>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
}>
|
||||
|
||||
<form id={formId} className="form-grid" onSubmit={submit}>
|
||||
{message && <DismissibleAlert tone="info" dismissible={false}>{message}</DismissibleAlert>}
|
||||
{error && <DismissibleAlert tone="danger" resetKey={error}>{error}</DismissibleAlert>}
|
||||
<FormField label="Email">
|
||||
<FormField label="i18n:govoplan-core.email.84add5b2">
|
||||
<input type="email" value={email} autoComplete="username" onChange={(e) => setEmail(e.target.value)} />
|
||||
</FormField>
|
||||
<FormField label="Password">
|
||||
<FormField label="i18n:govoplan-core.password.8be3c943">
|
||||
<PasswordField value={password} autoComplete="current-password" onValueChange={setPassword} />
|
||||
</FormField>
|
||||
</form>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
</Dialog>);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user