diff --git a/frontend/src/components/layout/Footer.tsx b/frontend/src/components/layout/Footer.tsx index 9e475bf..cf4670b 100644 --- a/frontend/src/components/layout/Footer.tsx +++ b/frontend/src/components/layout/Footer.tsx @@ -163,6 +163,7 @@ const Footer = () => { {/* Quick Links */} + {false && <> For Candidates @@ -173,8 +174,10 @@ const Footer = () => { Career Resources Interview Tips + } {/* Quick Links */} + {false && <> For Employers @@ -185,9 +188,10 @@ const Footer = () => { Recruiting Tools Pricing Plans - + } {/* Contact */} - + {false && <> + Company @@ -198,12 +202,12 @@ const Footer = () => { Careers Contact Us - + } {/* Newsletter */} - Email + Email {/* @@ -231,6 +235,7 @@ const Footer = () => { + {false && <> { Accessibility Sitemap + } diff --git a/frontend/src/components/layout/Header.tsx b/frontend/src/components/layout/Header.tsx index d72edd4..12124fc 100644 --- a/frontend/src/components/layout/Header.tsx +++ b/frontend/src/components/layout/Header.tsx @@ -149,8 +149,10 @@ const Header: React.FC = (props: HeaderProps) => { const [userMenuAnchor, setUserMenuAnchor] = useState(null); const userMenuOpen = Boolean(userMenuAnchor); + const isAdmin = user?.isAdmin || false; + // Get user menu items from navigation config - const userMenuGroups = getUserMenuItemsByGroup(user?.userType || null); + const userMenuGroups = getUserMenuItemsByGroup(user?.userType || null, isAdmin); // Create user menu items array with proper actions const createUserMenuItems = () => { @@ -210,6 +212,30 @@ const Header: React.FC = (props: HeaderProps) => { }); } + // Add admin group items + userMenuGroups.admin.forEach(item => { + if (!item.divider) { + items.push({ + id: item.id, + label: item.label as string, + icon: item.icon || null, + action: () => item.path && navigate(item.path), + group: 'admin' + }); + } + }); + + // Add divider if we have items before system group + if (items.length > 0 && userMenuGroups.admin.length > 0) { + items.push({ + id: 'divider', + label: '', + icon: null, + action: () => { }, + group: 'divider' + }); + } + // Add system group items with special handling for logout userMenuGroups.system.forEach(item => { if (item.id === 'logout') { @@ -311,14 +337,16 @@ const Header: React.FC = (props: HeaderProps) => { // Render desktop navigation with dropdowns const renderDesktopNavigation = () => { return ( - - {navigationItems.map((item) => { + + {navigationItems.map((item, index) => { const hasChildren = item.children && item.children.length > 0; const isActive = isCurrentPath(item) || hasActiveChild(item); if (hasChildren) { return ( - + handleDropdownOpen(e, item.id)} endIcon={} @@ -360,6 +388,7 @@ const Header: React.FC = (props: HeaderProps) => { sx={{ backgroundColor: isActive ? 'action.selected' : 'transparent', color: isActive ? 'secondary.main' : 'primary.contrastText', + mr: (index === 0 || index === navigationItems.length - 1) ? "auto" : "unset", }} > {item.icon && {item.icon}} diff --git a/frontend/src/config/navigationConfig.tsx b/frontend/src/config/navigationConfig.tsx index b981915..30ce38b 100644 --- a/frontend/src/config/navigationConfig.tsx +++ b/frontend/src/config/navigationConfig.tsx @@ -17,6 +17,7 @@ import { Quiz as QuizIcon, Analytics as AnalyticsIcon, BubbleChart, + AutoFixHigh, } from "@mui/icons-material"; import { BackstoryLogo } from "components/ui/BackstoryLogo"; @@ -131,11 +132,12 @@ export const navigationConfig: NavigationConfig = { id: "generate-candidate", label: "Generate Candidate", path: "/admin/generate-candidate", - icon: , + icon: , component: , userTypes: ["admin"], - showInNavigation: true, - userMenuGroup: "system", + showInNavigation: false, + showInUserMenu: true, + userMenuGroup: "admin", }, // User menu only items (not shown in main navigation) { @@ -298,7 +300,7 @@ export const navigationConfig: NavigationConfig = { // Utility functions for working with navigation config export const getNavigationItemsForUser = ( userType: "guest" | "candidate" | "employer" | null, - isAdmin: boolean = false + isAdmin: boolean ): NavigationItem[] => { const currentUserType = userType || "guest"; @@ -321,7 +323,7 @@ export const getNavigationItemsForUser = ( export const getAllRoutes = ( userType: "guest" | "candidate" | "employer" | null, - isAdmin: boolean = false + isAdmin: boolean ): NavigationItem[] => { const currentUserType = userType || "guest"; @@ -347,7 +349,7 @@ export const getAllRoutes = ( export const getMainNavigationItems = ( userType: "guest" | "candidate" | "employer" | null, - isAdmin: boolean = false + isAdmin: boolean ): NavigationItem[] => { return getNavigationItemsForUser(userType, isAdmin).filter( (item) => @@ -358,14 +360,14 @@ export const getMainNavigationItems = ( ); }; -export const getUserMenuItems = (userType: "candidate" | "employer" | "guest" | null): NavigationItem[] => { +export const getUserMenuItems = (userType: "candidate" | "employer" | "guest" | null, isAdmin: boolean): NavigationItem[] => { if (!userType) return []; const extractUserMenuItems = (items: NavigationItem[]): NavigationItem[] => { const menuItems: NavigationItem[] = []; items.forEach((item) => { - if (!item.userTypes || item.userTypes.includes(userType)) { + if (!item.userTypes || item.userTypes.includes(userType) || isAdmin) { if (item.showInUserMenu) { menuItems.push(item); } @@ -382,13 +384,15 @@ export const getUserMenuItems = (userType: "candidate" | "employer" | "guest" | }; export const getUserMenuItemsByGroup = ( - userType: "candidate" | "employer" | "guest" | null + userType: "candidate" | "employer" | "guest" | null, + isAdmin: boolean ): { [key: string]: NavigationItem[] } => { - const menuItems = getUserMenuItems(userType); + const menuItems = getUserMenuItems(userType, isAdmin); const grouped: { [key: string]: NavigationItem[] } = { profile: [], account: [], system: [], + admin: [], other: [], }; diff --git a/frontend/src/types/navigation.ts b/frontend/src/types/navigation.ts index 259c6c4..98bcbb1 100644 --- a/frontend/src/types/navigation.ts +++ b/frontend/src/types/navigation.ts @@ -12,7 +12,7 @@ export interface NavigationItem { divider?: boolean; showInNavigation?: boolean; // Controls if item appears in main navigation showInUserMenu?: boolean; // Controls if item appears in user menu - userMenuGroup?: 'profile' | 'account' | 'system'; // Groups items in user menu + userMenuGroup?: 'profile' | 'account' | 'system' | 'admin'; // Groups items in user menu } export interface NavigationConfig {