Rebuild the auth pages around a shared AuthPageLayout card with a three-tier guidance hierarchy: the form (or provider buttons) on top, a centered switch sentence below it, and a quiet explore band anchored to the card foot on public instances. - add AuthPageLayout (brand row, chip, empty state, link prompt, explore band gated by instance URL with hideExplore opt-out) - extract CredentialFields shared by sign-in and sign-up forms - extract IdentityProviderButtons; fetch the provider list via a cached TanStack Query hook with an enabled flag - cover every instance config: SSO-only, password-only, registrations closed, private instance, nothing enabled, first-run setup, admin - promote /auth/signup, /auth/admin, /auth/callback to ROUTES and add appendSearchParams for param-preserving auth links - move the explore link out of AuthFooter (selectors only now) - refresh en and zh-Hans auth strings; drop dead keys
33 lines
1,018 B
TypeScript
33 lines
1,018 B
TypeScript
import { ArrowLeftIcon, ShieldCheckIcon } from "lucide-react";
|
|
import { Link } from "react-router-dom";
|
|
import AuthPageLayout, { AuthChip } from "@/components/AuthPageLayout";
|
|
import PasswordSignInForm from "@/components/PasswordSignInForm";
|
|
import { ROUTES } from "@/router/routes";
|
|
import { useTranslate } from "@/utils/i18n";
|
|
|
|
const AdminSignIn = () => {
|
|
const t = useTranslate();
|
|
|
|
return (
|
|
<AuthPageLayout
|
|
chip={
|
|
<AuthChip>
|
|
<ShieldCheckIcon className="h-3 w-3" />
|
|
{t("common.admin")}
|
|
</AuthChip>
|
|
}
|
|
title={t("auth.admin-sign-in")}
|
|
subtitle={t("auth.admin-sign-in-tip")}
|
|
>
|
|
<PasswordSignInForm />
|
|
<p className="mt-5 text-center text-sm">
|
|
<Link to={ROUTES.AUTH} className="inline-flex items-center gap-1 text-primary hover:underline" viewTransition>
|
|
<ArrowLeftIcon className="h-3.5 w-3.5" />
|
|
{t("auth.back-to-sign-in")}
|
|
</Link>
|
|
</p>
|
|
</AuthPageLayout>
|
|
);
|
|
};
|
|
|
|
export default AdminSignIn;
|