From b4db4d8ab8322d8b51a9930e0088a1ebefa0a01c Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Tue, 28 Apr 2026 08:47:03 +0800 Subject: [PATCH] feat: redesign admin sidebar with grouped sections - Add Management and Moderation sections with labeled groups - Section labels: muted uppercase micro text - Section dividers: horizontal on desktop, vertical on mobile - Active state: bg-primary/10 text-primary rounded-lg - Widen desktop sidebar from md:w-48 to md:w-56 - Add desktop-only Admin Panel header with LayoutDashboardIcon - Expand nav to cover all 6 admin pages (users, hardware, games, reports, benchmarks, comments) - Update admin layout description to 'Manage your platform' --- app/(admin)/layout.tsx | 2 +- components/admin/admin-sidebar.tsx | 71 +++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/app/(admin)/layout.tsx b/app/(admin)/layout.tsx index 08ec25b..09a38c8 100644 --- a/app/(admin)/layout.tsx +++ b/app/(admin)/layout.tsx @@ -20,7 +20,7 @@ export default async function AdminLayout({

Admin

- Manage users, hardware, and games + Manage your platform

diff --git a/components/admin/admin-sidebar.tsx b/components/admin/admin-sidebar.tsx index 5a140ee..46ade83 100644 --- a/components/admin/admin-sidebar.tsx +++ b/components/admin/admin-sidebar.tsx @@ -2,31 +2,80 @@ import Link from "next/link" import { usePathname } from "next/navigation" -import { UsersIcon, CpuIcon, Gamepad2Icon, MessageSquareIcon } from "lucide-react" +import { + UsersIcon, + CpuIcon, + Gamepad2Icon, + MessageSquareIcon, + FlagIcon, + BarChart3Icon, + LayoutDashboardIcon, +} from "lucide-react" -const adminNavItems = [ - { href: "/admin/users", label: "Users", icon: UsersIcon }, - { href: "/admin/hardware", label: "Hardware", icon: CpuIcon }, - { href: "/admin/games", label: "Games", icon: Gamepad2Icon }, - { href: "/admin/comments", label: "Comments", icon: MessageSquareIcon }, +type NavItem = + | { type: "section"; label: string } + | { type: "divider" } + | { type: "link"; href: string; label: string; icon: React.ElementType } + +const navItems: NavItem[] = [ + { type: "section", label: "Management" }, + { type: "link", href: "/admin/users", label: "Users", icon: UsersIcon }, + { type: "link", href: "/admin/hardware", label: "Hardware", icon: CpuIcon }, + { type: "link", href: "/admin/games", label: "Games", icon: Gamepad2Icon }, + { type: "divider" }, + { type: "section", label: "Moderation" }, + { type: "link", href: "/admin/reports", label: "Reports", icon: FlagIcon }, + { type: "link", href: "/admin/benchmarks", label: "Benchmarks", icon: BarChart3Icon }, + { type: "link", href: "/admin/comments", label: "Comments", icon: MessageSquareIcon }, ] export function AdminSidebar() { const pathname = usePathname() return ( -