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:
1 parent
b621ec79a3
commit
928544100b
46 files changed
+790
-635
No files matched your search
+18
-12
@@ -1,6 +1,7 @@
|
||||
import { createBan, liftBan } from "@/actions/admin-bans";
|
||||
import { StatusCard } from "@/components/admin/dashboard";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { Ban } from "lucide-react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -27,10 +28,15 @@ export default async function AdminBans() {
|
||||
|
||||
return (
|
||||
<main>
|
||||
<h1>Bans</h1>
|
||||
<p className="muted" style={{ marginTop: "-0.4rem" }}>
|
||||
Active bans only (expiry in the future) · newest first.
|
||||
</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">
|
||||
<Ban size={20} className="text-[var(--color-primary)]" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="m-0 text-xl font-extrabold text-[var(--color-text)]">Bans</h1>
|
||||
<p className="m-0 text-xs text-[var(--color-text-muted)] mt-0.5">Active bans only (expiry in the future) · newest first.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3.5 mb-6">
|
||||
<StatusCard
|
||||
@@ -48,9 +54,9 @@ export default async function AdminBans() {
|
||||
<StatusCard label="Account bans" value={accountBans} icon="👤" />
|
||||
</div>
|
||||
|
||||
<form action={createBan} className="card" style={{ marginBottom: "1.5rem" }}>
|
||||
<h3 style={{ marginTop: 0 }}>New ban</h3>
|
||||
<div style={{ display: "flex", gap: "0.5rem", flexWrap: "wrap" }}>
|
||||
<form action={createBan} className="admin-card mb-6">
|
||||
<h3 className="text-sm font-bold text-[var(--color-text)] m-0 mb-3">New ban</h3>
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
<input name="userId" type="number" min={1} placeholder="User ID" required />
|
||||
<select name="type">
|
||||
<option value="account">account</option>
|
||||
@@ -59,7 +65,7 @@ export default async function AdminBans() {
|
||||
<option value="super">super</option>
|
||||
</select>
|
||||
<input name="hours" type="number" min={0} placeholder="Hours (0 = perm)" />
|
||||
<input name="reason" placeholder="Reason" style={{ flex: 1, minWidth: 160 }} />
|
||||
<input name="reason" placeholder="Reason" className="flex-1 min-w-[160px]" />
|
||||
<button type="submit" className="btn btn-danger">
|
||||
Ban
|
||||
</button>
|
||||
@@ -67,11 +73,11 @@ export default async function AdminBans() {
|
||||
</form>
|
||||
|
||||
<section className="mt-6">
|
||||
<h2>Active bans ({bans.length})</h2>
|
||||
<h2 className="admin-section-title">Active bans ({bans.length})</h2>
|
||||
{bans.length === 0 ? (
|
||||
<p className="muted">No active bans.</p>
|
||||
<div className="admin-empty">No active bans.</div>
|
||||
) : (
|
||||
<div style={{ overflowX: "auto" }}>
|
||||
<div className="overflow-x-auto">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -94,7 +100,7 @@ export default async function AdminBans() {
|
||||
{b.banExpire === 0 ? (
|
||||
<span className="inline-block text-[0.72rem] font-bold px-2 py-0.5 rounded-full bg-red-500/22 text-[var(--color-text)]">permanent</span>
|
||||
) : (
|
||||
<span className="muted" style={{ whiteSpace: "nowrap" }}>
|
||||
<span className="text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap">
|
||||
{fromUnix(b.banExpire)}
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user