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>);
|
||||
|
||||
}
|
||||
@@ -7,48 +7,48 @@ export default function PublicLandingPage({
|
||||
settings,
|
||||
maintenanceMode,
|
||||
onLogin
|
||||
}: {
|
||||
settings: ApiSettings;
|
||||
maintenanceMode?: { enabled: boolean; message?: string | null };
|
||||
onLogin: (response: LoginResponse) => void;
|
||||
}) {
|
||||
|
||||
|
||||
|
||||
|
||||
}: {settings: ApiSettings;maintenanceMode?: {enabled: boolean;message?: string | null;};onLogin: (response: LoginResponse) => void;}) {
|
||||
const [loginOpen, setLoginOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="public-landing">
|
||||
<section className="public-card">
|
||||
<div className="public-kicker">GovOPlaN</div>
|
||||
<h1>Modular planning tools with controlled access.</h1>
|
||||
<div className="public-kicker">i18n:govoplan-core.govoplan.a84c0a85</div>
|
||||
<h1>i18n:govoplan-core.modular_planning_tools_with_controlled_access.1d6b0743</h1>
|
||||
<p>
|
||||
Sign in to open the modules available to your tenant and role.
|
||||
i18n:govoplan-core.sign_in_to_open_the_modules_available_to_your_te.8bb7dab4
|
||||
</p>
|
||||
|
||||
{maintenanceMode?.enabled && (
|
||||
<div className="public-maintenance alert warning">
|
||||
<strong>Maintenance mode is active.</strong>
|
||||
<span>{maintenanceMode.message || "Only users with maintenance access can use the system right now."}</span>
|
||||
{maintenanceMode?.enabled &&
|
||||
<div className="public-maintenance alert warning">
|
||||
<strong>i18n:govoplan-core.maintenance_mode_is_active.70f918d9</strong>
|
||||
<span>{maintenanceMode.message || "i18n:govoplan-core.only_users_with_maintenance_access_can_use_the_s.5566264f"}</span>
|
||||
</div>
|
||||
)}
|
||||
}
|
||||
|
||||
<div className="public-actions">
|
||||
<Button variant="primary" onClick={() => setLoginOpen(true)}>Sign in</Button>
|
||||
<Button variant="primary" onClick={() => setLoginOpen(true)}>i18n:govoplan-core.sign_in.ada2e9e9</Button>
|
||||
</div>
|
||||
|
||||
<div className="public-footnote">
|
||||
Access is restricted. Sign in to open available modules and administration.
|
||||
i18n:govoplan-core.access_is_restricted_sign_in_to_open_available_m.2a47a549
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{loginOpen && (
|
||||
<LoginModal
|
||||
settings={settings}
|
||||
onClose={() => setLoginOpen(false)}
|
||||
onLogin={(response) => {
|
||||
onLogin(response);
|
||||
setLoginOpen(false);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
{loginOpen &&
|
||||
<LoginModal
|
||||
settings={settings}
|
||||
onClose={() => setLoginOpen(false)}
|
||||
onLogin={(response) => {
|
||||
onLogin(response);
|
||||
setLoginOpen(false);
|
||||
}} />
|
||||
|
||||
}
|
||||
</div>);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user