From a64836c94acb8afaaced1d7e9637d3f400a50610 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Thu, 26 Feb 2026 03:28:08 +0000 Subject: [PATCH] feat(timetable): add navigation links to Header component --- src/pages/Header.tsx | 283 +++++++++++++++++++++++++++---------------- 1 file changed, 178 insertions(+), 105 deletions(-) diff --git a/src/pages/Header.tsx b/src/pages/Header.tsx index ca626dc..3122ae9 100644 --- a/src/pages/Header.tsx +++ b/src/pages/Header.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; -import { +import { AppBar, Toolbar, Typography, @@ -15,7 +15,7 @@ import { Divider } from '@mui/material'; import MenuIcon from '@mui/icons-material/Menu'; -import { +import { Login as LoginIcon, Logout as LogoutIcon, School as TeacherIcon, @@ -29,7 +29,12 @@ import { Settings as SettingsIcon, Search as SearchIcon, AdminPanelSettings as AdminIcon, - Home as HomeIcon + Home as HomeIcon, + // Timetable icons + Schedule as ScheduleIcon, + Class as ClassIcon, + Book as BookIcon, + HowToReg as EnrollmentIcon } from '@mui/icons-material'; import { HEADER_HEIGHT } from './Layout'; import { logger } from '../debugConfig'; @@ -49,7 +54,7 @@ const Header: React.FC = () => { useEffect(() => { const newAuthState = !!user; setIsAuthenticated(newAuthState); - logger.debug('user-context', '🔄 User state changed in header', { + logger.debug('user-context', '🔄 User state changed in header', { hasUser: newAuthState, userId: user?.id, userEmail: user?.email, @@ -80,7 +85,6 @@ const Header: React.FC = () => { try { logger.debug('auth-service', '🔄 Signing out user', { userId: user?.id }); await signOut(); - // Clear local state immediately setIsAuthenticated(false); setAnchorEl(null); logger.debug('auth-service', '✅ User signed out'); @@ -91,85 +95,62 @@ const Header: React.FC = () => { }; return ( - - - - navigate(isAuthenticated ? '/dashboard' : '/')} - > - ClassroomCopilot - - - - + {showGraphNavigation && ( - + )} + + handleNavigation('/')} + > + + Classroom Copilot + + + + {isAuthenticated && ( + + {user?.email} + + )} - { > + + + Navigation + + {isAuthenticated ? [ - handleNavigation('/dashboard')}> + // Home + handleNavigation('/')}> - + , - , - // Development Tools Section - handleNavigation('/tldraw-dev')}> - - - - - , - handleNavigation('/dev')}> - - - - - , - , + , - // Main Features Section - handleNavigation('/multiplayer')}> + // Timetable Section + + Timetable & Classes + , + handleNavigation('/timetable')}> - + - + , + handleNavigation('/classes')}> + + + + + , + handleNavigation('/my-classes')}> + + + + + , + handleNavigation('/enrollment-requests')}> + + + + + , + , + + // Features Section + + Features + , handleNavigation('/calendar')}> , - handleNavigation('/teacher-planner')}> + handleNavigation('/teacher-planner')}> , - handleNavigation('/exam-marker')}> + handleNavigation('/exam-marker')}> @@ -243,6 +286,21 @@ const Header: React.FC = () => { , // Utilities Section + + Utilities + , handleNavigation('/settings')}> @@ -259,6 +317,21 @@ const Header: React.FC = () => { // Admin Section ...(isAdmin ? [ , + + Administration + , handleNavigation('/admin')}> @@ -288,7 +361,7 @@ const Header: React.FC = () => { - @@ -297,7 +370,7 @@ const Header: React.FC = () => { - @@ -310,4 +383,4 @@ const Header: React.FC = () => { ); }; -export default Header; +export default Header;