Mabye ready for beta?!?!
This commit is contained in:
parent
d2d0bb29ac
commit
53e0d4aafb
@ -163,6 +163,7 @@ const Footer = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* Quick Links */}
|
{/* Quick Links */}
|
||||||
|
{false && <>
|
||||||
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
||||||
<FooterHeading variant="subtitle1">
|
<FooterHeading variant="subtitle1">
|
||||||
For Candidates
|
For Candidates
|
||||||
@ -173,8 +174,10 @@ const Footer = () => {
|
|||||||
<FooterLink href="/career-resources">Career Resources</FooterLink>
|
<FooterLink href="/career-resources">Career Resources</FooterLink>
|
||||||
<FooterLink href="/interview-tips">Interview Tips</FooterLink>
|
<FooterLink href="/interview-tips">Interview Tips</FooterLink>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</>}
|
||||||
|
|
||||||
{/* Quick Links */}
|
{/* Quick Links */}
|
||||||
|
{false && <>
|
||||||
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
||||||
<FooterHeading variant="subtitle1">
|
<FooterHeading variant="subtitle1">
|
||||||
For Employers
|
For Employers
|
||||||
@ -185,9 +188,10 @@ const Footer = () => {
|
|||||||
<FooterLink href="/recruiting-tools">Recruiting Tools</FooterLink>
|
<FooterLink href="/recruiting-tools">Recruiting Tools</FooterLink>
|
||||||
<FooterLink href="/pricing-plans">Pricing Plans</FooterLink>
|
<FooterLink href="/pricing-plans">Pricing Plans</FooterLink>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</>}
|
||||||
{/* Contact */}
|
{/* Contact */}
|
||||||
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
{false && <>
|
||||||
|
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
|
||||||
<FooterHeading variant="subtitle1">
|
<FooterHeading variant="subtitle1">
|
||||||
Company
|
Company
|
||||||
</FooterHeading>
|
</FooterHeading>
|
||||||
@ -198,12 +202,12 @@ const Footer = () => {
|
|||||||
<FooterLink href="/careers">Careers</FooterLink>
|
<FooterLink href="/careers">Careers</FooterLink>
|
||||||
<FooterLink href="/contact-us">Contact Us</FooterLink>
|
<FooterLink href="/contact-us">Contact Us</FooterLink>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</>}
|
||||||
{/* Newsletter */}
|
{/* Newsletter */}
|
||||||
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
|
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
|
||||||
<ContactItem>
|
<ContactItem>
|
||||||
<Email sx={{ mr: 1, fontSize: 20 }} />
|
<Email sx={{ mr: 1, fontSize: 20 }} />
|
||||||
<FooterLink href="mailto:james_backstory@backstory.ketrenos.com">Email</FooterLink>
|
<FooterLink href="mailto:james_backstory@ketrenos.com">Email</FooterLink>
|
||||||
</ContactItem>
|
</ContactItem>
|
||||||
{/* <ContactItem>
|
{/* <ContactItem>
|
||||||
<Phone sx={{ mr: 1, fontSize: 20 }} />
|
<Phone sx={{ mr: 1, fontSize: 20 }} />
|
||||||
@ -231,6 +235,7 @@ const Footer = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 12, md: 6 }}>
|
<Grid size={{ xs: 12, md: 6 }}>
|
||||||
|
{false && <>
|
||||||
<Stack
|
<Stack
|
||||||
direction={isMobile ? 'column' : 'row'}
|
direction={isMobile ? 'column' : 'row'}
|
||||||
spacing={isMobile ? 1 : 3}
|
spacing={isMobile ? 1 : 3}
|
||||||
@ -241,6 +246,7 @@ const Footer = () => {
|
|||||||
<FooterLink href="/accessibility" sx={{ mb: 0 }}>Accessibility</FooterLink>
|
<FooterLink href="/accessibility" sx={{ mb: 0 }}>Accessibility</FooterLink>
|
||||||
<FooterLink href="/sitemap" sx={{ mb: 0 }}>Sitemap</FooterLink>
|
<FooterLink href="/sitemap" sx={{ mb: 0 }}>Sitemap</FooterLink>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</>}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -149,8 +149,10 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
|
|||||||
const [userMenuAnchor, setUserMenuAnchor] = useState<null | HTMLElement>(null);
|
const [userMenuAnchor, setUserMenuAnchor] = useState<null | HTMLElement>(null);
|
||||||
const userMenuOpen = Boolean(userMenuAnchor);
|
const userMenuOpen = Boolean(userMenuAnchor);
|
||||||
|
|
||||||
|
const isAdmin = user?.isAdmin || false;
|
||||||
|
|
||||||
// Get user menu items from navigation config
|
// 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
|
// Create user menu items array with proper actions
|
||||||
const createUserMenuItems = () => {
|
const createUserMenuItems = () => {
|
||||||
@ -210,6 +212,30 @@ const Header: React.FC<HeaderProps> = (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
|
// Add system group items with special handling for logout
|
||||||
userMenuGroups.system.forEach(item => {
|
userMenuGroups.system.forEach(item => {
|
||||||
if (item.id === 'logout') {
|
if (item.id === 'logout') {
|
||||||
@ -311,14 +337,16 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
|
|||||||
// Render desktop navigation with dropdowns
|
// Render desktop navigation with dropdowns
|
||||||
const renderDesktopNavigation = () => {
|
const renderDesktopNavigation = () => {
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'space-between' }}>
|
||||||
{navigationItems.map((item) => {
|
{navigationItems.map((item, index) => {
|
||||||
const hasChildren = item.children && item.children.length > 0;
|
const hasChildren = item.children && item.children.length > 0;
|
||||||
const isActive = isCurrentPath(item) || hasActiveChild(item);
|
const isActive = isCurrentPath(item) || hasActiveChild(item);
|
||||||
|
|
||||||
if (hasChildren) {
|
if (hasChildren) {
|
||||||
return (
|
return (
|
||||||
<Box key={item.id}>
|
<Box key={item.id} sx={{
|
||||||
|
mr: (index === 0 || index === navigationItems.length - 1) ? "auto" : "unset",
|
||||||
|
}}>
|
||||||
<DropdownButton
|
<DropdownButton
|
||||||
onClick={(e) => handleDropdownOpen(e, item.id)}
|
onClick={(e) => handleDropdownOpen(e, item.id)}
|
||||||
endIcon={<KeyboardArrowDown />}
|
endIcon={<KeyboardArrowDown />}
|
||||||
@ -360,6 +388,7 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
|
|||||||
sx={{
|
sx={{
|
||||||
backgroundColor: isActive ? 'action.selected' : 'transparent',
|
backgroundColor: isActive ? 'action.selected' : 'transparent',
|
||||||
color: isActive ? 'secondary.main' : 'primary.contrastText',
|
color: isActive ? 'secondary.main' : 'primary.contrastText',
|
||||||
|
mr: (index === 0 || index === navigationItems.length - 1) ? "auto" : "unset",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{item.icon && <Box sx={{ mr: 1, display: 'flex' }}>{item.icon}</Box>}
|
{item.icon && <Box sx={{ mr: 1, display: 'flex' }}>{item.icon}</Box>}
|
||||||
|
@ -17,6 +17,7 @@ import {
|
|||||||
Quiz as QuizIcon,
|
Quiz as QuizIcon,
|
||||||
Analytics as AnalyticsIcon,
|
Analytics as AnalyticsIcon,
|
||||||
BubbleChart,
|
BubbleChart,
|
||||||
|
AutoFixHigh,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
|
|
||||||
import { BackstoryLogo } from "components/ui/BackstoryLogo";
|
import { BackstoryLogo } from "components/ui/BackstoryLogo";
|
||||||
@ -131,11 +132,12 @@ export const navigationConfig: NavigationConfig = {
|
|||||||
id: "generate-candidate",
|
id: "generate-candidate",
|
||||||
label: "Generate Candidate",
|
label: "Generate Candidate",
|
||||||
path: "/admin/generate-candidate",
|
path: "/admin/generate-candidate",
|
||||||
icon: <PersonIcon />,
|
icon: <AutoFixHigh />,
|
||||||
component: <GenerateCandidate />,
|
component: <GenerateCandidate />,
|
||||||
userTypes: ["admin"],
|
userTypes: ["admin"],
|
||||||
showInNavigation: true,
|
showInNavigation: false,
|
||||||
userMenuGroup: "system",
|
showInUserMenu: true,
|
||||||
|
userMenuGroup: "admin",
|
||||||
},
|
},
|
||||||
// User menu only items (not shown in main navigation)
|
// User menu only items (not shown in main navigation)
|
||||||
{
|
{
|
||||||
@ -298,7 +300,7 @@ export const navigationConfig: NavigationConfig = {
|
|||||||
// Utility functions for working with navigation config
|
// Utility functions for working with navigation config
|
||||||
export const getNavigationItemsForUser = (
|
export const getNavigationItemsForUser = (
|
||||||
userType: "guest" | "candidate" | "employer" | null,
|
userType: "guest" | "candidate" | "employer" | null,
|
||||||
isAdmin: boolean = false
|
isAdmin: boolean
|
||||||
): NavigationItem[] => {
|
): NavigationItem[] => {
|
||||||
const currentUserType = userType || "guest";
|
const currentUserType = userType || "guest";
|
||||||
|
|
||||||
@ -321,7 +323,7 @@ export const getNavigationItemsForUser = (
|
|||||||
|
|
||||||
export const getAllRoutes = (
|
export const getAllRoutes = (
|
||||||
userType: "guest" | "candidate" | "employer" | null,
|
userType: "guest" | "candidate" | "employer" | null,
|
||||||
isAdmin: boolean = false
|
isAdmin: boolean
|
||||||
): NavigationItem[] => {
|
): NavigationItem[] => {
|
||||||
const currentUserType = userType || "guest";
|
const currentUserType = userType || "guest";
|
||||||
|
|
||||||
@ -347,7 +349,7 @@ export const getAllRoutes = (
|
|||||||
|
|
||||||
export const getMainNavigationItems = (
|
export const getMainNavigationItems = (
|
||||||
userType: "guest" | "candidate" | "employer" | null,
|
userType: "guest" | "candidate" | "employer" | null,
|
||||||
isAdmin: boolean = false
|
isAdmin: boolean
|
||||||
): NavigationItem[] => {
|
): NavigationItem[] => {
|
||||||
return getNavigationItemsForUser(userType, isAdmin).filter(
|
return getNavigationItemsForUser(userType, isAdmin).filter(
|
||||||
(item) =>
|
(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 [];
|
if (!userType) return [];
|
||||||
|
|
||||||
const extractUserMenuItems = (items: NavigationItem[]): NavigationItem[] => {
|
const extractUserMenuItems = (items: NavigationItem[]): NavigationItem[] => {
|
||||||
const menuItems: NavigationItem[] = [];
|
const menuItems: NavigationItem[] = [];
|
||||||
|
|
||||||
items.forEach((item) => {
|
items.forEach((item) => {
|
||||||
if (!item.userTypes || item.userTypes.includes(userType)) {
|
if (!item.userTypes || item.userTypes.includes(userType) || isAdmin) {
|
||||||
if (item.showInUserMenu) {
|
if (item.showInUserMenu) {
|
||||||
menuItems.push(item);
|
menuItems.push(item);
|
||||||
}
|
}
|
||||||
@ -382,13 +384,15 @@ export const getUserMenuItems = (userType: "candidate" | "employer" | "guest" |
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getUserMenuItemsByGroup = (
|
export const getUserMenuItemsByGroup = (
|
||||||
userType: "candidate" | "employer" | "guest" | null
|
userType: "candidate" | "employer" | "guest" | null,
|
||||||
|
isAdmin: boolean
|
||||||
): { [key: string]: NavigationItem[] } => {
|
): { [key: string]: NavigationItem[] } => {
|
||||||
const menuItems = getUserMenuItems(userType);
|
const menuItems = getUserMenuItems(userType, isAdmin);
|
||||||
const grouped: { [key: string]: NavigationItem[] } = {
|
const grouped: { [key: string]: NavigationItem[] } = {
|
||||||
profile: [],
|
profile: [],
|
||||||
account: [],
|
account: [],
|
||||||
system: [],
|
system: [],
|
||||||
|
admin: [],
|
||||||
other: [],
|
other: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export interface NavigationItem {
|
|||||||
divider?: boolean;
|
divider?: boolean;
|
||||||
showInNavigation?: boolean; // Controls if item appears in main navigation
|
showInNavigation?: boolean; // Controls if item appears in main navigation
|
||||||
showInUserMenu?: boolean; // Controls if item appears in user menu
|
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 {
|
export interface NavigationConfig {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user