feat: wire AWARD_MASTER into auth redirects and role-switch navigation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-06 16:35:34 -04:00
parent 4d68392ada
commit f61cebe6ae
3 changed files with 4 additions and 1 deletions

View File

@@ -162,6 +162,7 @@ const ROLE_SWITCH_OPTIONS: Record<string, { label: string; path: string; icon: t
JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale }, JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale },
MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake }, MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake },
OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye }, OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye },
AWARD_MASTER: { label: 'Award Master', path: '/award-master', icon: Trophy },
} }
export function AdminSidebar({ user }: AdminSidebarProps) { export function AdminSidebar({ user }: AdminSidebarProps) {

View File

@@ -19,7 +19,7 @@ import {
import type { Route } from 'next' import type { Route } from 'next'
import type { LucideIcon } from 'lucide-react' import type { LucideIcon } from 'lucide-react'
import { import {
LogOut, Menu, Moon, Settings, Sun, User, X, LogOut, Menu, Moon, Settings, Sun, User, X, Trophy,
LayoutDashboard, Scale, Handshake, Eye, ArrowRightLeft, LayoutDashboard, Scale, Handshake, Eye, ArrowRightLeft,
ExternalLink as ExternalLinkIcon, HelpCircle, Mail, ExternalLink as ExternalLinkIcon, HelpCircle, Mail,
} from 'lucide-react' } from 'lucide-react'
@@ -61,6 +61,7 @@ const ROLE_SWITCH_OPTIONS: Record<string, { label: string; path: string; icon: t
JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale }, JURY_MEMBER: { label: 'Jury View', path: '/jury', icon: Scale },
MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake }, MENTOR: { label: 'Mentor View', path: '/mentor', icon: Handshake },
OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye }, OBSERVER: { label: 'Observer View', path: '/observer', icon: Eye },
AWARD_MASTER: { label: 'Award Master', path: '/award-master', icon: Trophy },
} }
function isNavItemActive(pathname: string, href: string, basePath: string): boolean { function isNavItemActive(pathname: string, href: string, basePath: string): boolean {

View File

@@ -10,6 +10,7 @@ const ROLE_DASHBOARDS: Record<string, string> = {
MENTOR: '/mentor', MENTOR: '/mentor',
OBSERVER: '/observer', OBSERVER: '/observer',
APPLICANT: '/applicant', APPLICANT: '/applicant',
AWARD_MASTER: '/award-master',
} }
export async function requireRole(...allowedRoles: UserRole[]) { export async function requireRole(...allowedRoles: UserRole[]) {