Extended the same design-system treatment to the public site, faithful to AtomCMS's "atom" theme. New src/components/public/ui.tsx provides the signature atom building blocks + a scoped CSS layer: - ContentCard: surface card with a primary-tinted header (icon circle + title + subtitle) and padded body — the atom content-card, used as every page's header and section wrapper. - StatBlock / stat-grid, EmptyState, OnlineBadge (online/offline pill), RankBadge (medals for the top 3), and responsive .card-grid helpers. Swept ~45 public pages (home/community/rankings hand-built as the reference; the rest via parallel agents that read the schema and preserved every query, server action, auth gate and field name): heroes → ContentCard headers, lists → card-grids in ContentCards, "no X" → EmptyState, status → OnlineBadge/RankBadge. The leaderboard gained Credits/Diamonds/Duckets tabs (usersCurrency). Behaviour unchanged. Verified on the prod server against amx_test: 15+ public pages render the content-cards/grids with real data, no errors; computed styles confirm the tinted header, icon circle, medal + online pills. Fixed an undefined --color-golden ref. tsc 0, vitest 49/49, next build 0.
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import Link from "next/link";
|
|
import { resetPassword } from "@/actions/password-reset";
|
|
import { ContentCard } from "@/components/public/ui";
|
|
|
|
export default async function ResetPage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ email?: string; token?: string; error?: string }>;
|
|
}) {
|
|
const { email = "", token = "", error } = await searchParams;
|
|
|
|
return (
|
|
<main style={{ maxWidth: 420, margin: "2rem auto" }}>
|
|
<ContentCard
|
|
icon="🔐"
|
|
title="Set a new password"
|
|
subtitle="Choose a strong password you don't use elsewhere."
|
|
>
|
|
<form action={resetPassword} style={{ display: "grid", gap: "0.7rem" }}>
|
|
<input type="hidden" name="email" value={email} />
|
|
<input type="hidden" name="token" value={token} />
|
|
<input
|
|
name="password"
|
|
type="password"
|
|
placeholder="New password (min 6 chars)"
|
|
autoComplete="new-password"
|
|
required
|
|
/>
|
|
<button type="submit" className="btn btn-primary">
|
|
Reset password
|
|
</button>
|
|
</form>
|
|
{error ? (
|
|
<p style={{ color: "var(--color-danger)", textAlign: "center", marginBottom: 0 }}>
|
|
{error}
|
|
</p>
|
|
) : null}
|
|
<p className="muted" style={{ textAlign: "center", marginBottom: 0, marginTop: "1rem" }}>
|
|
<Link href="/login">Back to login</Link>
|
|
</p>
|
|
</ContentCard>
|
|
</main>
|
|
);
|
|
}
|