Skip to content

Add super admin section on admin sidebar #5

@balebbae

Description

@balebbae

Summary

Add a dedicated super admin section to the admin sidebar that only renders for users with the super_admin role. This groups super admin navigation links into a clearly labeled section, separate from the existing Applicants and Event sections.

Current State

The sidebar (client/web/src/pages/admin/_shared/AppSidebar.tsx) currently has:

  • Header: NavUser component (avatar, name, email, dropdown)
  • Content: Two NavSection components — "Applicants" and "Event"
  • Footer: A conditional Settings button that already checks user?.role === 'super_admin'

The Settings button in the footer opens a SettingsDialog modal — this should be moved into the new super admin nav section as a proper navigation link (or kept as-is, depending on preference).

Implementation Details

Files to modify

File Change
client/web/src/pages/admin/_shared/AppSidebar.tsx Add conditional NavSection for super admin links

What to add

Define a superAdminNav items array and conditionally render it after the Event section:

const superAdminNav = [
  { name: 'Dashboard', url: '/superadmin', icon: LayoutDashboard },
  { name: 'Settings', url: '/superadmin/settings', icon: Settings },
  // Future: Set Admin, Email Applicants, etc.
]
{/* Inside SidebarContent, after the Event NavSection */}
{user?.role === 'super_admin' && (
  <NavSection
    label="Super Admin"
    items={superAdminNav}
    currentPath={location.pathname}
  />
)}

Existing patterns to follow

  • Role access: const { user } = useUserStore()user?.role === 'super_admin'
  • NavSection pattern: Reuse the existing NavSection component which takes label, items[] (name, url, icon), and currentPath
  • Icons: Import from lucide-react (already used throughout the sidebar)
  • Route guards: Super admin pages are already wrapped with <RequireSuperAdmin> in routes.tsx

Acceptance Criteria

  • New "Super Admin" NavSection added to sidebar content
  • Section only renders when user?.role === 'super_admin'
  • At least one navigation link (Decisions → /decisions)
  • Follows existing NavSection component pattern

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions