Adapt + improve all public pages to the atom design system
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.
This commit is contained in:
1 parent
0de0ac6a3c
commit
e9ea19795a
47 files changed
+2264
-1714
No files matched your search
+16
-22
@@ -1,5 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import RedeemForm from "./RedeemForm";
|
||||
import { ContentCard, StatBlock } from "@/components/public/ui";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
@@ -25,36 +26,29 @@ export default async function RedeemPage() {
|
||||
if (!user) redirect("/login");
|
||||
|
||||
return (
|
||||
<main>
|
||||
<div className="hero">
|
||||
<h1 style={{ marginBottom: "0.25rem" }}>Redeem a voucher</h1>
|
||||
<p className="muted" style={{ margin: 0 }}>
|
||||
Got a voucher code? Enter it below to add the reward to your account.
|
||||
</p>
|
||||
</div>
|
||||
<main style={{ display: "grid", gap: "1.5rem" }}>
|
||||
<ContentCard
|
||||
icon="🎟️"
|
||||
title="Redeem a voucher"
|
||||
subtitle="Got a voucher code? Enter it below to add the reward to your account."
|
||||
/>
|
||||
|
||||
<div className="grid cols-2">
|
||||
<div className="card">
|
||||
<h3 style={{ marginTop: 0 }}>Enter your code</h3>
|
||||
<div className="card-grid sm-2">
|
||||
<ContentCard icon="🔑" title="Enter your code">
|
||||
<RedeemForm />
|
||||
<p className="muted" style={{ marginBottom: 0 }}>
|
||||
<p className="muted" style={{ marginBottom: 0, marginTop: "0.85rem" }}>
|
||||
Each voucher can only be redeemed once per account.
|
||||
</p>
|
||||
</div>
|
||||
</ContentCard>
|
||||
|
||||
<div className="card">
|
||||
<h3 style={{ marginTop: 0 }}>Your balance</h3>
|
||||
<p style={{ margin: "0 0 0.6rem" }}>
|
||||
Signed in as <strong>{user.username}</strong>.
|
||||
</p>
|
||||
<span className="currency">
|
||||
<span className="coin credits">cr</span>
|
||||
{user.credits.toLocaleString()}
|
||||
</span>
|
||||
<ContentCard icon="💰" title="Your balance" subtitle={`Signed in as ${user.username}`}>
|
||||
<div className="stat-grid">
|
||||
<StatBlock value={user.credits.toLocaleString()} label="Credits" icon="🪙" />
|
||||
</div>
|
||||
<p className="muted" style={{ marginBottom: 0, marginTop: "0.85rem" }}>
|
||||
Redeemed rewards are credited instantly and appear in-game the next time you log in.
|
||||
</p>
|
||||
</div>
|
||||
</ContentCard>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user