diff --git a/app/admin/layout.tsx b/app/admin/layout.tsx index c7eb1734..7c2c1f1a 100644 --- a/app/admin/layout.tsx +++ b/app/admin/layout.tsx @@ -19,15 +19,35 @@ import { cn } from '@/lib/utils'; import { useConfig } from '@/hooks/use-config'; import { useThemeStore } from '@/stores/theme-store'; -const NAV_ITEMS = [ - { href: '/admin', label: 'Dashboard', icon: LayoutDashboard }, - { href: '/admin/settings', label: 'Settings', icon: Settings }, - { href: '/admin/branding', label: 'Branding', icon: Palette }, - { href: '/admin/auth', label: 'Authentication', icon: Shield }, - { href: '/admin/policy', label: 'Policy', icon: Scale }, - { href: '/admin/plugins', label: 'Plugins', icon: Puzzle }, - { href: '/admin/themes', label: 'Themes', icon: SwatchBook }, - { href: '/admin/logs', label: 'Audit Log', icon: ScrollText }, +const NAV_GROUPS = [ + { + label: 'Overview', + items: [ + { href: '/admin', label: 'Dashboard', icon: LayoutDashboard }, + ], + }, + { + label: 'Configuration', + items: [ + { href: '/admin/settings', label: 'Settings', icon: Settings }, + { href: '/admin/branding', label: 'Branding', icon: Palette }, + { href: '/admin/auth', label: 'Authentication', icon: Shield }, + { href: '/admin/policy', label: 'Policy', icon: Scale }, + ], + }, + { + label: 'Extensions', + items: [ + { href: '/admin/plugins', label: 'Plugins', icon: Puzzle }, + { href: '/admin/themes', label: 'Themes', icon: SwatchBook }, + ], + }, + { + label: 'System', + items: [ + { href: '/admin/logs', label: 'Audit Log', icon: ScrollText }, + ], + }, ]; export default function AdminLayout({ children }: { children: React.ReactNode }) { @@ -41,9 +61,11 @@ export default function AdminLayout({ children }: { children: React.ReactNode }) : (appLogoLightUrl || appLogoDarkUrl || loginLogoLightUrl); useEffect(() => { - checkAuth(); + if (pathname !== '/admin/login') { + checkAuth(); + } // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [pathname]); async function checkAuth() { try { @@ -84,8 +106,8 @@ export default function AdminLayout({ children }: { children: React.ReactNode }) return (
{/* Sidebar */} -