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:
Simo committed 2026-06-28 19:28:36 +02:00
1 parent 0de0ac6a3c
commit e9ea19795a
47 files changed
+2264 -1714

No files matched your search

+50 -27
View File
@@ -1,4 +1,5 @@
import Link from "next/link";
import { ContentCard, EmptyState } from "@/components/public/ui";
import { excerpt } from "@/lib/format";
import { prisma } from "@/lib/prisma";
import { siteSettings } from "@/lib/services/site-settings";
@@ -20,13 +21,16 @@ export default async function HomePage() {
}
return (
<main>
<section className="hero">
<h1 style={{ fontSize: 36, marginTop: 0 }}>Welcome to {hotelName}</h1>
<p className="muted" style={{ fontSize: 16 }}>
Your retro hotel, now powered by Next.js. Hang out, collect furni, and meet friends.
<main style={{ display: "grid", gap: "1.5rem" }}>
<ContentCard
icon="🏨"
title={`Welcome to ${hotelName}`}
subtitle="Your retro hotel, now powered by Next.js"
>
<p className="muted" style={{ margin: "0 0 0.9rem" }}>
Hang out, collect furni, and meet friends.
</p>
<div style={{ display: "flex", gap: "0.6rem", marginTop: "0.5rem" }}>
<div style={{ display: "flex", gap: "0.6rem", flexWrap: "wrap" }}>
<Link className="btn btn-primary" href="/client">
Enter hotel
</Link>
@@ -34,28 +38,47 @@ export default async function HomePage() {
Latest news
</Link>
</div>
</section>
</ContentCard>
<h2>Latest news</h2>
{articles.length === 0 ? (
<p className="muted">No articles yet.</p>
) : (
<div className="grid cols-2">
{articles.map((a) => (
<article key={a.slug} className="card hover article">
{a.image ? <img className="article-img" src={a.image} alt="" /> : <div className="article-img" />}
<div className="body">
<h3 style={{ margin: "0 0 0.3rem" }}>
<Link href={`/news/${a.slug}`}>{a.title}</Link>
</h3>
<p className="muted" style={{ margin: 0 }}>
{excerpt(a.shortStory, 120)}
</p>
</div>
</article>
))}
</div>
)}
<ContentCard
icon="📰"
title="Latest news"
subtitle="Fresh from the hotel"
action={
<Link className="btn btn-outline" href="/news">
All news →
</Link>
}
>
{articles.length === 0 ? (
<EmptyState icon="📰">No articles yet.</EmptyState>
) : (
<div className="card-grid sm-2 lg-4">
{articles.map((a) => (
<article
key={a.slug}
className="card hover"
style={{ padding: 0, overflow: "hidden" }}
>
{a.image ? (
// biome-ignore lint/performance/noImgElement: external article image
<img className="article-img" src={a.image} alt="" />
) : (
<div className="article-img" />
)}
<div style={{ padding: "0.85rem" }}>
<h3 style={{ margin: "0 0 0.3rem", fontSize: "1rem" }}>
<Link href={`/news/${a.slug}`}>{a.title}</Link>
</h3>
<p className="muted" style={{ margin: 0 }}>
{excerpt(a.shortStory, 110)}
</p>
</div>
</article>
))}
</div>
)}
</ContentCard>
</main>
);
}