From 067df34c5017e52406e5dd7c660e245bd6014da0 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Thu, 26 Feb 2026 07:28:47 +0000 Subject: [PATCH] fix: correct Material UI icon naming in Header.tsx and update timetable components - Fix icon naming: remove 'Icon' suffix from MUI icon components in Header.tsx (AccessTime, Close, Person, School, Schedule, Class, Book, Settings, Student, Login, Logout) - Update timetable components to use UserContext instead of ProfileContext - Fix timetableService naming collision and circular reference - Update various components for consistency --- src/components/common/Modal.tsx | 4 +- src/pages/Header.tsx | 73 +++++++++---------- src/pages/NotFoundPublic.tsx | 2 +- src/pages/dev/SimpleUploadTest.tsx | 16 ++-- src/pages/timetable/ClassDetailPage.tsx | 22 +++--- src/pages/timetable/ClassesPage.tsx | 16 ++-- .../timetable/EnrollmentRequestsPage.tsx | 14 ++-- src/pages/timetable/LessonPage.tsx | 20 ++--- src/pages/timetable/MyClassesPage.tsx | 20 ++--- src/pages/timetable/TimetablePage.tsx | 14 ++-- .../CCDoclingViewer.tsx | 4 +- .../CCEnhancedFilePanel.tsx | 14 ++-- .../CCFileDetailPanel.tsx | 14 ++-- src/pages/user/NotFound.tsx | 2 +- src/services/timetableService.ts | 3 +- .../shared/navigation/CCNodeSnapshotPanel.tsx | 7 +- 16 files changed, 123 insertions(+), 122 deletions(-) diff --git a/src/components/common/Modal.tsx b/src/components/common/Modal.tsx index e22c57f..83bb00a 100644 --- a/src/components/common/Modal.tsx +++ b/src/components/common/Modal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { CloseIcon } from '@mui/icons-material'; +import Close from '@mui/icons-material/Close'; interface ModalProps { isOpen: boolean; @@ -32,7 +32,7 @@ const Modal: React.FC = ({ isOpen, onClose, title, children, maxWidt onClick={onClose} className="text-gray-400 hover:text-gray-500 focus:outline-none" > - + diff --git a/src/pages/Header.tsx b/src/pages/Header.tsx index 3122ae9..38a726e 100644 --- a/src/pages/Header.tsx +++ b/src/pages/Header.tsx @@ -15,27 +15,24 @@ import { Divider } from '@mui/material'; import MenuIcon from '@mui/icons-material/Menu'; -import { - Login as LoginIcon, - Logout as LogoutIcon, - School as TeacherIcon, - Person as StudentIcon, - Dashboard as TLDrawDevIcon, - Build as DevToolsIcon, - Groups as MultiplayerIcon, - CalendarToday as CalendarIcon, - Assignment as TeacherPlannerIcon, - AssignmentTurnedIn as ExamMarkerIcon, - Settings as SettingsIcon, - Search as SearchIcon, - AdminPanelSettings as AdminIcon, - Home as HomeIcon, - // Timetable icons - Schedule as ScheduleIcon, - Class as ClassIcon, - Book as BookIcon, - HowToReg as EnrollmentIcon -} from '@mui/icons-material'; +import Login from '@mui/icons-material/Login'; +import Logout from '@mui/icons-material/Logout'; +import Teacher from '@mui/icons-material/School'; +import Student from '@mui/icons-material/Person'; +import TLDrawDev from '@mui/icons-material/Dashboard'; +import DevTools from '@mui/icons-material/Build'; +import Multiplayer from '@mui/icons-material/Groups'; +import Calendar from '@mui/icons-material/CalendarToday'; +import TeacherPlanner from '@mui/icons-material/Assignment'; +import ExamMarker from '@mui/icons-material/AssignmentTurnedIn'; +import Settings from '@mui/icons-material/Settings'; +import Search from '@mui/icons-material/Search'; +import Admin from '@mui/icons-material/AdminPanelSettings'; +import Home from '@mui/icons-material/Home'; +import Schedule from '@mui/icons-material/Schedule'; +import Class from '@mui/icons-material/Class'; +import Book from '@mui/icons-material/Book'; +import Enrollment from '@mui/icons-material/HowToReg'; import { HEADER_HEIGHT } from './Layout'; import { logger } from '../debugConfig'; import { GraphNavigator } from '../components/navigation/GraphNavigator'; @@ -127,7 +124,7 @@ const Header: React.FC = () => { }} onClick={() => handleNavigation('/')} > - + Classroom Copilot @@ -156,7 +153,7 @@ const Header: React.FC = () => { } }} > - + { // Home handleNavigation('/')}> - + , @@ -213,7 +210,7 @@ const Header: React.FC = () => { , handleNavigation('/timetable')}> - + { , handleNavigation('/classes')}> - + { , handleNavigation('/my-classes')}> - + { , handleNavigation('/enrollment-requests')}> - + { , handleNavigation('/calendar')}> - + , handleNavigation('/teacher-planner')}> - + , handleNavigation('/exam-marker')}> - + , @@ -303,13 +300,13 @@ const Header: React.FC = () => { , handleNavigation('/settings')}> - + , handleNavigation('/search')}> - + , @@ -334,7 +331,7 @@ const Header: React.FC = () => { , handleNavigation('/admin')}> - + @@ -344,7 +341,7 @@ const Header: React.FC = () => { , - + @@ -352,14 +349,14 @@ const Header: React.FC = () => { // Authentication Section for Non-authenticated Users handleNavigation('/login')}> - + , , handleSignupNavigation('teacher')}> - + { , handleSignupNavigation('student')}> - + - + 404 diff --git a/src/pages/dev/SimpleUploadTest.tsx b/src/pages/dev/SimpleUploadTest.tsx index baf26b1..9729a34 100644 --- a/src/pages/dev/SimpleUploadTest.tsx +++ b/src/pages/dev/SimpleUploadTest.tsx @@ -454,7 +454,7 @@ const SimpleUploadTest: React.FC = () => { } + avatar={} /> @@ -497,7 +497,7 @@ const SimpleUploadTest: React.FC = () => { /> @@ -115,7 +115,7 @@ const ClassDetailPage: React.FC = () => {
- +

Timetables

@@ -126,7 +126,7 @@ const ClassDetailPage: React.FC = () => {
- +

Students

@@ -137,7 +137,7 @@ const ClassDetailPage: React.FC = () => {
- +

Teachers

@@ -194,7 +194,7 @@ const ClassDetailPage: React.FC = () => { to={`/timetable/classes/${classId}/timetables/new`} className="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" > - + Add Timetable )} @@ -202,7 +202,7 @@ const ClassDetailPage: React.FC = () => { {timetables.length === 0 ? (
- +

No timetables yet

Create a timetable to start scheduling lessons

@@ -221,7 +221,7 @@ const ClassDetailPage: React.FC = () => { {timetable.is_recurring && ' • Recurring'}

- + ))}
@@ -234,7 +234,7 @@ const ClassDetailPage: React.FC = () => {

Enrolled Students

{enrolledStudents.length === 0 ? (
- +

No students enrolled

Students can request enrollment or be added by teachers

diff --git a/src/pages/timetable/ClassesPage.tsx b/src/pages/timetable/ClassesPage.tsx index 34e4194..a248ab3 100644 --- a/src/pages/timetable/ClassesPage.tsx +++ b/src/pages/timetable/ClassesPage.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; -import { AddIcon, CalendarTodayIcon, FilterListIcon, MenuBookIcon, PeopleIcon, SearchIcon } from '@mui/icons-material'; +import { Add, CalendarToday, FilterList, MenuBook, People, Search } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import { useUser } from '../../contexts/UserContext'; @@ -70,7 +70,7 @@ const ClassesPage: React.FC = () => { onClick={() => navigate('/timetable/classes/create')} className="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" > - + Create Class )} @@ -80,7 +80,7 @@ const ClassesPage: React.FC = () => {
- + { onClick={() => setShowFilters(!showFilters)} className="inline-flex items-center gap-2 px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors" > - + Filters
) : classes.length === 0 ? (
- +

No classes found

{searchQuery || filterSubject || filterSchoolYear @@ -191,7 +191,7 @@ const ClassesPage: React.FC = () => { >

- +
{cls.subject} @@ -203,11 +203,11 @@ const ClassesPage: React.FC = () => {

- + {cls.student_count} students - + {cls.timetable_count} timetables
diff --git a/src/pages/timetable/EnrollmentRequestsPage.tsx b/src/pages/timetable/EnrollmentRequestsPage.tsx index f6ff620..978a8a9 100644 --- a/src/pages/timetable/EnrollmentRequestsPage.tsx +++ b/src/pages/timetable/EnrollmentRequestsPage.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { CheckIcon, CloseIcon, FilterListIcon, KeyboardArrowDownIcon, PeopleIcon, PersonAddIcon, SearchIcon } from '@mui/icons-material'; +import { Check, Close, FilterList, KeyboardArrowDown, People, PersonAdd, Search } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import Modal from '../../components/common/Modal'; @@ -105,7 +105,7 @@ const EnrollmentRequestsPage: React.FC = () => {
{/* Class Filter */}
- + {
- +
@@ -230,7 +230,7 @@ const EnrollmentRequestsPage: React.FC = () => { }} className="inline-flex items-center px-3 py-1 border border-transparent text-xs font-medium rounded text-green-700 bg-green-100 hover:bg-green-200" > - + Approve
@@ -259,7 +259,7 @@ const EnrollmentRequestsPage: React.FC = () => {
) : (
- +

No enrollment requests

{filters.status === 'pending' diff --git a/src/pages/timetable/LessonPage.tsx b/src/pages/timetable/LessonPage.tsx index 49b44a9..c797c39 100644 --- a/src/pages/timetable/LessonPage.tsx +++ b/src/pages/timetable/LessonPage.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { useParams, Link, useNavigate } from 'react-router-dom'; -import { AccessTimeIcon, ArrowBackIcon, CalendarTodayIcon, CancelIcon, CheckCircleIcon, DeleteIcon, DescriptionIcon, EditIcon, LocationOnIcon, MenuBookIcon, PeopleIcon } from '@mui/icons-material'; +import { AccessTime, ArrowBack, CalendarToday, Cancel, CheckCircle, Delete, Description, Edit, LocationOn, MenuBook, People } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import { useUser } from '../../contexts/UserContext'; import { format, parseISO } from 'date-fns'; @@ -119,7 +119,7 @@ const LessonPage: React.FC = () => { to={`/timetable/timetables/${currentTimetable?.id}`} className="inline-flex items-center text-gray-500 hover:text-gray-700 mb-2" > - + Back to Timetable

{currentLesson.title}

@@ -133,14 +133,14 @@ const LessonPage: React.FC = () => { onClick={() => setIsEditModalOpen(true)} className="inline-flex items-center px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors" > - + Edit
@@ -151,12 +151,12 @@ const LessonPage: React.FC = () => {

- + Time & Location

- +

Date

@@ -165,7 +165,7 @@ const LessonPage: React.FC = () => {

- +

Time

@@ -175,7 +175,7 @@ const LessonPage: React.FC = () => {

{(currentLesson.location || currentLesson.room) && (
- +

Location

@@ -191,7 +191,7 @@ const LessonPage: React.FC = () => {

- + Class Information

@@ -218,7 +218,7 @@ const LessonPage: React.FC = () => {

- + Attendance

diff --git a/src/pages/timetable/MyClassesPage.tsx b/src/pages/timetable/MyClassesPage.tsx index 448aabd..d8a6105 100644 --- a/src/pages/timetable/MyClassesPage.tsx +++ b/src/pages/timetable/MyClassesPage.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { Link } from 'react-router-dom'; -import { AccessTimeIcon, KeyboardArrowRightIcon, MenuBookIcon, PeopleIcon, SchoolIcon } from '@mui/icons-material'; +import { AccessTime, KeyboardArrowRight, MenuBook, People, School } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import { useUser } from '../../contexts/UserContext'; @@ -78,7 +78,7 @@ const MyClassesPage: React.FC = () => { {teachingClasses.length > 0 && (
- +

Teaching

{teachingClasses.length} @@ -102,7 +102,7 @@ const MyClassesPage: React.FC = () => {

{classItem.class.code}

)}
- +

@@ -120,12 +120,12 @@ const MyClassesPage: React.FC = () => {

- + {classItem.class?.enrolled_count || 0} students
{classItem.class?.academic_year && (
- + {classItem.class.academic_year}
)} @@ -141,7 +141,7 @@ const MyClassesPage: React.FC = () => { {enrolledClasses.length > 0 && (
- +

Enrolled

{enrolledClasses.length} @@ -165,7 +165,7 @@ const MyClassesPage: React.FC = () => {

{classItem.class.code}

)}
- +

@@ -180,14 +180,14 @@ const MyClassesPage: React.FC = () => {

- + {classItem.class?.teachers?.[0]?.first_name} {classItem.class?.teachers?.[0]?.last_name}
{classItem.class?.academic_year && (
- + {classItem.class.academic_year}
)} @@ -202,7 +202,7 @@ const MyClassesPage: React.FC = () => { {/* Empty State */} {myClasses.length === 0 && (
- +

No classes found

You are not enrolled in or teaching any classes yet. diff --git a/src/pages/timetable/TimetablePage.tsx b/src/pages/timetable/TimetablePage.tsx index b139575..a55b012 100644 --- a/src/pages/timetable/TimetablePage.tsx +++ b/src/pages/timetable/TimetablePage.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useParams, Link, useNavigate } from 'react-router-dom'; -import { AccessTimeIcon, AddIcon, ArrowBackIcon, CalendarTodayIcon, DeleteIcon, EditIcon, KeyboardArrowLeftIcon, KeyboardArrowRightIcon, LocationOnIcon } from '@mui/icons-material'; +import { AccessTime, Add, ArrowBack, CalendarToday, Delete, Edit, KeyboardArrowLeft, KeyboardArrowRight, LocationOn } from '@mui/icons-material'; import useTimetableStore from '../../stores/timetableStore'; import { useUser } from '../../contexts/UserContext'; import { format, parseISO, addDays, startOfWeek, isSameDay } from 'date-fns'; @@ -81,7 +81,7 @@ const TimetablePage: React.FC = () => { to={`/timetable/classes/${currentTimetable.class_id}`} className="inline-flex items-center gap-2 text-gray-500 hover:text-gray-700 mb-4" > - + Back to Class @@ -90,7 +90,7 @@ const TimetablePage: React.FC = () => {

{currentTimetable.name}

- + {format(parseISO(currentTimetable.effective_from), 'MMM d, yyyy')} {currentTimetable.effective_until && ` - ${format(parseISO(currentTimetable.effective_until), 'MMM d, yyyy')}`} @@ -107,14 +107,14 @@ const TimetablePage: React.FC = () => { to={`/timetable/timetables/${timetableId}/lessons/new`} className="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" > - + Add Lesson
@@ -131,7 +131,7 @@ const TimetablePage: React.FC = () => { {currentLessons.length === 0 ? (
- +

No lessons scheduled

Add lessons to build your timetable

@@ -171,7 +171,7 @@ const TimetablePage: React.FC = () => {
{lesson.location && (
- + {lesson.location}
)} diff --git a/src/pages/tldraw/CCDocumentIntelligence/CCDoclingViewer.tsx b/src/pages/tldraw/CCDocumentIntelligence/CCDoclingViewer.tsx index a2d3e1a..faaadf8 100644 --- a/src/pages/tldraw/CCDocumentIntelligence/CCDoclingViewer.tsx +++ b/src/pages/tldraw/CCDocumentIntelligence/CCDoclingViewer.tsx @@ -327,9 +327,9 @@ export const CCDoclingViewer: React.FC<{ {!hideToolbar && ( - handlePageChange(start - 1)} disabled={start <= 1}> + handlePageChange(start - 1)} disabled={start <= 1}> Section {start}–{end} - handlePageChange(end + 1)} disabled={end >= totalPages}> + handlePageChange(end + 1)} disabled={end >= totalPages}> )} diff --git a/src/pages/tldraw/CCDocumentIntelligence/CCEnhancedFilePanel.tsx b/src/pages/tldraw/CCDocumentIntelligence/CCEnhancedFilePanel.tsx index 9f3c025..20b5bdb 100644 --- a/src/pages/tldraw/CCDocumentIntelligence/CCEnhancedFilePanel.tsx +++ b/src/pages/tldraw/CCDocumentIntelligence/CCEnhancedFilePanel.tsx @@ -3,10 +3,14 @@ import { Box, CircularProgress, IconButton, Typography, Collapse, Chip, List, ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; -import { - ExpandMore, ChevronRight, Description, Check, Schedule, - Visibility, Psychology, Home as OverviewIcon -} from '@mui/icons-material'; +import ExpandMore from '@mui/icons-material/ExpandMore'; +import ChevronRight from '@mui/icons-material/ChevronRight'; +import Description from '@mui/icons-material/Description'; +import Check from '@mui/icons-material/Check'; +import Schedule from '@mui/icons-material/Schedule'; +import Visibility from '@mui/icons-material/Visibility'; +import Psychology from '@mui/icons-material/Psychology'; +import Overview from '@mui/icons-material/Home'; import { supabase } from '../../../supabaseClient'; // Types @@ -345,7 +349,7 @@ export const CCEnhancedFilePanel: React.FC = ({ color={selectedView === 'overview' ? 'primary' : 'default'} title="Processing Overview" > - + - onSelectPage(Math.max(1, selectedPage - 1))}> + onSelectPage(Math.max(1, selectedPage - 1))}> - onSelectPage(Math.min(manifest.page_count, selectedPage + 1))}> + onSelectPage(Math.min(manifest.page_count, selectedPage + 1))}> / {manifest.page_count} @@ -186,8 +186,8 @@ export const CCFileDetailPanel: React.FC<{ {outline && outline.sections.length > 0 && ( - setCollapsed(new Set())}> - setCollapsed(new Set(collectAllIds(outline.sections)))}> + setCollapsed(new Set())}> + setCollapsed(new Set(collectAllIds(outline.sections)))}> )} @@ -202,8 +202,8 @@ export const CCFileDetailPanel: React.FC<{ Sections - setCollapsed(new Set())}> - setCollapsed(new Set(collectAllIds(outline.sections)))}> + setCollapsed(new Set())}> + setCollapsed(new Set(collectAllIds(outline.sections)))}> )} @@ -291,7 +291,7 @@ const SectionTile: React.FC<{ borderBottom: '1px solid var(--color-divider)' }}> { e.stopPropagation(); toggleCollapse(s.id); }}> - {isCollapsed ? : } + {isCollapsed ? : } onSelectPage(Math.max(1, s.start_page))}> {s.title} diff --git a/src/pages/user/NotFound.tsx b/src/pages/user/NotFound.tsx index f078faf..4d95fbe 100644 --- a/src/pages/user/NotFound.tsx +++ b/src/pages/user/NotFound.tsx @@ -36,7 +36,7 @@ function NotFound() { gap: 3 }} > - + 404 diff --git a/src/services/timetableService.ts b/src/services/timetableService.ts index 71c153f..9aae48d 100644 --- a/src/services/timetableService.ts +++ b/src/services/timetableService.ts @@ -325,9 +325,8 @@ export const enrollmentService = { // Combined Export // ============================================================================ -export const timetableService = { +export const timetableServiceExports = { ...classService, - ...timetableService, ...lessonService, ...enrollmentService, }; diff --git a/src/utils/tldraw/ui-overrides/components/shared/navigation/CCNodeSnapshotPanel.tsx b/src/utils/tldraw/ui-overrides/components/shared/navigation/CCNodeSnapshotPanel.tsx index 601e15d..9d154a5 100644 --- a/src/utils/tldraw/ui-overrides/components/shared/navigation/CCNodeSnapshotPanel.tsx +++ b/src/utils/tldraw/ui-overrides/components/shared/navigation/CCNodeSnapshotPanel.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import { Box, Typography, styled, Button, ThemeProvider, createTheme, useMediaQuery } from '@mui/material'; -import { Save as SaveIcon, RestartAlt as ResetIcon } from '@mui/icons-material'; +import Save from '@mui/icons-material/Save'; +import Reset from '@mui/icons-material/RestartAlt'; import { useEditor, useToasts, loadSnapshot } from '@tldraw/tldraw'; import { useNavigationStore } from '../../../../../../stores/navigationStore'; import { UserNeoDBService } from '../../../../../../services/graph/userNeoDBService'; @@ -173,7 +174,7 @@ export const CCNodeSnapshotPanel: React.FC = () => { } + startIcon={} onClick={handleSaveSnapshot} disabled={isLoading} sx={{ flex: 1 }} @@ -183,7 +184,7 @@ export const CCNodeSnapshotPanel: React.FC = () => { } + startIcon={} onClick={handleResetCanvas} disabled={isLoading} sx={{ flex: 1 }}