Convert admin pages to new Tailwind design pattern

- Replace 'card' class with 'admin-card' (gradient cards, dark mode support)
- Replace 'muted' class with consistent Tailwind muted states
- Standardize page headers with gradient backgrounds and Lucide icons
- Convert all inline styles to Tailwind classes
- Add admin-page CSS helpers (admin-card, admin-filter-bar, admin-section-title)
- Apply pattern to all 42 admin pages (was only 6 before)
- Zero TypeScript errors, production builds successfully

Co-authored-by: openhands <[email protected]>
This commit is contained in:
openhands committed 2026-07-02 16:05:35 +02:00
1 parent b621ec79a3
commit 928544100b
46 files changed
+790 -635

No files matched your search

+23 -35
View File
@@ -1,3 +1,4 @@
import { Wrench } from "lucide-react";
import { saveMaintenance } from "@/actions/admin-maintenance";
import { StatusCard } from "@/components/admin/dashboard";
import { prisma } from "@/lib/prisma";
@@ -34,12 +35,15 @@ export default async function AdminMaintenance() {
return (
<main>
<h1>Maintenance Mode</h1>
<p className="muted" style={{ marginTop: "-0.4rem" }}>
While maintenance is enabled, only staff (and users at or above the
minimum login rank) can log into the hotel. These values are stored in
<code> website_settings</code> and read live by the login flow.
</p>
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-[var(--color-primary)]/20 to-[var(--color-primary)]/5 grid place-items-center">
<Wrench size={20} className="text-[var(--color-primary)]" />
</div>
<div>
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">Maintenance Mode</h1>
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">While maintenance is enabled, only staff (and users at or above the minimum login rank) can log into the hotel. These values are stored in <code>website_settings</code> and read live by the login flow.</p>
</div>
</div>
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
<StatusCard
@@ -65,8 +69,8 @@ export default async function AdminMaintenance() {
{/* ── Current state ─────────────────────────────────────── */}
<section className="mt-6">
<h2>Current state</h2>
<div className="card" style={{ display: "flex", alignItems: "center", gap: "0.75rem" }}>
<h2 className="admin-section-title">Current state</h2>
<div className="admin-card flex items-center gap-3">
<span className={`inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full ${enabled ? "bg-red-500/22 text-[var(--color-text)]" : "bg-green-600/20 text-[var(--color-text)]"}`}>
{enabled ? "ENABLED" : "disabled"}
</span>
@@ -74,7 +78,7 @@ export default async function AdminMaintenance() {
<strong>
Maintenance is currently {enabled ? "ENABLED" : "disabled"}.
</strong>
<p className="muted" style={{ margin: "0.2rem 0 0" }}>
<p className="text-xs text-gray-500 dark:text-gray-400 mt-1 m-0">
{enabled
? `Only users with rank ${minRankValue} or higher can log in right now.`
: "The hotel is open to everyone."}
@@ -85,34 +89,22 @@ export default async function AdminMaintenance() {
{/* ── Edit form ─────────────────────────────────────────── */}
<section className="mt-6">
<h2>Settings</h2>
<form action={saveMaintenance} className="card">
<label
htmlFor="mt-enabled"
style={{
display: "flex",
alignItems: "center",
gap: "0.5rem",
marginBottom: "1rem",
}}
>
<h2 className="admin-section-title">Settings</h2>
<form action={saveMaintenance} className="admin-card">
<label htmlFor="mt-enabled" className="flex items-center gap-2 mb-4">
<input
id="mt-enabled"
type="checkbox"
name="enabled"
value="1"
defaultChecked={enabled}
style={{ width: "auto" }}
className="w-auto"
/>
<span>Enable maintenance mode</span>
</label>
<div style={{ marginBottom: "1rem", maxWidth: 220 }}>
<label
htmlFor="mt-min-rank"
className="muted"
style={{ display: "block", marginBottom: "0.3rem" }}
>
<div className="mb-4 max-w-[220px]">
<label htmlFor="mt-min-rank" className="text-sm text-gray-500 dark:text-gray-400 block mb-1">
Minimum login rank during maintenance
</label>
<input
@@ -122,16 +114,12 @@ export default async function AdminMaintenance() {
min={0}
step={1}
defaultValue={minRankValue}
style={{ width: "100%" }}
className="w-full"
/>
</div>
<div style={{ marginBottom: "1rem" }}>
<label
htmlFor="mt-message"
className="muted"
style={{ display: "block", marginBottom: "0.3rem" }}
>
<div className="mb-4">
<label htmlFor="mt-message" className="text-sm text-gray-500 dark:text-gray-400 block mb-1">
Maintenance message (shown on the splash; basic HTML allowed)
</label>
<textarea
@@ -140,7 +128,7 @@ export default async function AdminMaintenance() {
rows={8}
defaultValue={message}
placeholder="We're working hard on the hotel — back soon!"
style={{ width: "100%", resize: "vertical" }}
className="w-full resize-y"
/>
</div>