Mabye ready for beta?!?!

This commit is contained in:
James Ketr 2025-06-11 16:16:34 -07:00
parent d2d0bb29ac
commit 53e0d4aafb
4 changed files with 58 additions and 19 deletions

View File

@ -163,6 +163,7 @@ const Footer = () => {
</Grid>
{/* Quick Links */}
{false && <>
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
<FooterHeading variant="subtitle1">
For Candidates
@ -173,8 +174,10 @@ const Footer = () => {
<FooterLink href="/career-resources">Career Resources</FooterLink>
<FooterLink href="/interview-tips">Interview Tips</FooterLink>
</Grid>
</>}
{/* Quick Links */}
{false && <>
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
<FooterHeading variant="subtitle1">
For Employers
@ -185,9 +188,10 @@ const Footer = () => {
<FooterLink href="/recruiting-tools">Recruiting Tools</FooterLink>
<FooterLink href="/pricing-plans">Pricing Plans</FooterLink>
</Grid>
</>}
{/* Contact */}
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
{false && <>
<Grid size={{ xs: 12, sm: 6, md: 2 }}>
<FooterHeading variant="subtitle1">
Company
</FooterHeading>
@ -198,12 +202,12 @@ const Footer = () => {
<FooterLink href="/careers">Careers</FooterLink>
<FooterLink href="/contact-us">Contact Us</FooterLink>
</Grid>
</>}
{/* Newsletter */}
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
<ContactItem>
<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>
<Phone sx={{ mr: 1, fontSize: 20 }} />
@ -231,6 +235,7 @@ const Footer = () => {
</Box>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
{false && <>
<Stack
direction={isMobile ? 'column' : 'row'}
spacing={isMobile ? 1 : 3}
@ -241,6 +246,7 @@ const Footer = () => {
<FooterLink href="/accessibility" sx={{ mb: 0 }}>Accessibility</FooterLink>
<FooterLink href="/sitemap" sx={{ mb: 0 }}>Sitemap</FooterLink>
</Stack>
</>}
</Grid>
</Grid>
</Container>

View File

@ -149,8 +149,10 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
const [userMenuAnchor, setUserMenuAnchor] = useState<null | HTMLElement>(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<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
userMenuGroups.system.forEach(item => {
if (item.id === 'logout') {
@ -311,14 +337,16 @@ const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
// Render desktop navigation with dropdowns
const renderDesktopNavigation = () => {
return (
<Box sx={{ display: 'flex', alignItems: 'center' }}>
{navigationItems.map((item) => {
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%', justifyContent: 'space-between' }}>
{navigationItems.map((item, index) => {
const hasChildren = item.children && item.children.length > 0;
const isActive = isCurrentPath(item) || hasActiveChild(item);
if (hasChildren) {
return (
<Box key={item.id}>
<Box key={item.id} sx={{
mr: (index === 0 || index === navigationItems.length - 1) ? "auto" : "unset",
}}>
<DropdownButton
onClick={(e) => handleDropdownOpen(e, item.id)}
endIcon={<KeyboardArrowDown />}
@ -360,6 +388,7 @@ const Header: React.FC<HeaderProps> = (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 && <Box sx={{ mr: 1, display: 'flex' }}>{item.icon}</Box>}

View File

@ -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: <PersonIcon />,
icon: <AutoFixHigh />,
component: <GenerateCandidate />,
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: [],
};

View File

@ -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 {