refactor: rename admin to manage in layout, sidebar, and redirects

This commit is contained in:
2026-04-29 01:31:44 +08:00
parent b68bf36bff
commit 6642501b91
3 changed files with 16 additions and 17 deletions
+6 -6
View File
@@ -1,15 +1,15 @@
import { AdminSidebar } from "@/components/admin/admin-sidebar"
import { ManageSidebar } from "@/components/manage/manage-sidebar"
import type { Metadata } from "next"
export const metadata: Metadata = {
title: {
template: "%s | Admin — DeckyVault",
default: "Admin — DeckyVault",
template: "%s | Manage — DeckyVault",
default: "Manage — DeckyVault",
},
robots: { index: false, follow: false },
}
export default async function AdminLayout({
export default async function ManageLayout({
children,
}: {
children: React.ReactNode
@@ -18,7 +18,7 @@ export default async function AdminLayout({
<section className='w-full flex flex-col gap-8 py-16'>
<div className='px-4 md:px-[10svw]'>
<div className='max-w-7xl mx-auto'>
<h1 className='text-2xl sm:text-3xl font-bold'>Admin</h1>
<h1 className='text-2xl sm:text-3xl font-bold'>Manage</h1>
<p className='text-sm text-text/60 mt-1'>
Manage your platform
</p>
@@ -27,7 +27,7 @@ export default async function AdminLayout({
<div className='px-4 md:px-[10svw]'>
<div className='max-w-7xl mx-auto flex flex-col md:flex-row gap-6'>
<AdminSidebar />
<ManageSidebar />
<div className='flex-1 min-w-0'>{children}</div>
</div>
</div>
+2 -2
View File
@@ -1,5 +1,5 @@
import { redirect } from "next/navigation"
export default function AdminPage() {
redirect("/admin/users")
export default function ManagePage() {
redirect("/manage/users")
}
@@ -19,25 +19,24 @@ type NavItem =
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: "link", href: "/manage/users", label: "Users", icon: UsersIcon },
{ type: "link", href: "/manage/hardware", label: "Hardware", icon: CpuIcon },
{ type: "link", href: "/manage/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 },
{ type: "link", href: "/manage/reports", label: "Reports", icon: FlagIcon },
{ type: "link", href: "/manage/benchmarks", label: "Benchmarks", icon: BarChart3Icon },
{ type: "link", href: "/manage/comments", label: "Comments", icon: MessageSquareIcon },
]
export function AdminSidebar() {
export function ManageSidebar() {
const pathname = usePathname()
return (
<nav className="md:w-56 shrink-0">
{/* Desktop header */}
<div className="hidden md:flex items-center gap-2 px-3 py-2 mb-2 text-sm font-semibold text-text/70">
<LayoutDashboardIcon className="h-4 w-4" />
Admin Panel
Manage Panel
</div>
<div className="flex md:flex-col gap-1 overflow-x-auto md:overflow-visible pb-2 md:pb-0 md:border-r md:border-border md:pr-3">