refactor: rename admin to manage in layout, sidebar, and redirects
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
import { AdminSidebar } from "@/components/admin/admin-sidebar"
|
import { ManageSidebar } from "@/components/manage/manage-sidebar"
|
||||||
import type { Metadata } from "next"
|
import type { Metadata } from "next"
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: {
|
title: {
|
||||||
template: "%s | Admin — DeckyVault",
|
template: "%s | Manage — DeckyVault",
|
||||||
default: "Admin — DeckyVault",
|
default: "Manage — DeckyVault",
|
||||||
},
|
},
|
||||||
robots: { index: false, follow: false },
|
robots: { index: false, follow: false },
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function AdminLayout({
|
export default async function ManageLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
@@ -18,7 +18,7 @@ export default async function AdminLayout({
|
|||||||
<section className='w-full flex flex-col gap-8 py-16'>
|
<section className='w-full flex flex-col gap-8 py-16'>
|
||||||
<div className='px-4 md:px-[10svw]'>
|
<div className='px-4 md:px-[10svw]'>
|
||||||
<div className='max-w-7xl mx-auto'>
|
<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'>
|
<p className='text-sm text-text/60 mt-1'>
|
||||||
Manage your platform
|
Manage your platform
|
||||||
</p>
|
</p>
|
||||||
@@ -27,7 +27,7 @@ export default async function AdminLayout({
|
|||||||
|
|
||||||
<div className='px-4 md:px-[10svw]'>
|
<div className='px-4 md:px-[10svw]'>
|
||||||
<div className='max-w-7xl mx-auto flex flex-col md:flex-row gap-6'>
|
<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 className='flex-1 min-w-0'>{children}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { redirect } from "next/navigation"
|
import { redirect } from "next/navigation"
|
||||||
|
|
||||||
export default function AdminPage() {
|
export default function ManagePage() {
|
||||||
redirect("/admin/users")
|
redirect("/manage/users")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,25 +19,24 @@ type NavItem =
|
|||||||
|
|
||||||
const navItems: NavItem[] = [
|
const navItems: NavItem[] = [
|
||||||
{ type: "section", label: "Management" },
|
{ type: "section", label: "Management" },
|
||||||
{ type: "link", href: "/admin/users", label: "Users", icon: UsersIcon },
|
{ type: "link", href: "/manage/users", label: "Users", icon: UsersIcon },
|
||||||
{ type: "link", href: "/admin/hardware", label: "Hardware", icon: CpuIcon },
|
{ type: "link", href: "/manage/hardware", label: "Hardware", icon: CpuIcon },
|
||||||
{ type: "link", href: "/admin/games", label: "Games", icon: Gamepad2Icon },
|
{ type: "link", href: "/manage/games", label: "Games", icon: Gamepad2Icon },
|
||||||
{ type: "divider" },
|
{ type: "divider" },
|
||||||
{ type: "section", label: "Moderation" },
|
{ type: "section", label: "Moderation" },
|
||||||
{ type: "link", href: "/admin/reports", label: "Reports", icon: FlagIcon },
|
{ type: "link", href: "/manage/reports", label: "Reports", icon: FlagIcon },
|
||||||
{ type: "link", href: "/admin/benchmarks", label: "Benchmarks", icon: BarChart3Icon },
|
{ type: "link", href: "/manage/benchmarks", label: "Benchmarks", icon: BarChart3Icon },
|
||||||
{ type: "link", href: "/admin/comments", label: "Comments", icon: MessageSquareIcon },
|
{ type: "link", href: "/manage/comments", label: "Comments", icon: MessageSquareIcon },
|
||||||
]
|
]
|
||||||
|
|
||||||
export function AdminSidebar() {
|
export function ManageSidebar() {
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="md:w-56 shrink-0">
|
<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">
|
<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" />
|
<LayoutDashboardIcon className="h-4 w-4" />
|
||||||
Admin Panel
|
Manage Panel
|
||||||
</div>
|
</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">
|
<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">
|
||||||
Reference in New Issue
Block a user