fix(contexts): replace ProfileContext with UserContext in timetable pages
This commit is contained in:
parent
c7207eb805
commit
00a6f941c7
@ -2,13 +2,13 @@ import React, { useEffect, useState } from 'react';
|
||||
import { useParams, Link, useNavigate } from 'react-router-dom';
|
||||
import { AccessTimeIcon, AddIcon, ArrowBackIcon, CalendarTodayIcon, DeleteIcon, EditIcon, MenuBookIcon, PeopleIcon } from '@mui/icons-material';
|
||||
import useTimetableStore from '../../stores/timetableStore';
|
||||
import { useProfile } from '../../contexts/ProfileContext';
|
||||
import { useUser } from '../../contexts/UserContext';
|
||||
import Modal from '../../components/common/Modal';
|
||||
|
||||
const ClassDetailPage: React.FC = () => {
|
||||
const { classId } = useParams<{ classId: string }>();
|
||||
const navigate = useNavigate();
|
||||
const { profile } = useProfile();
|
||||
const { profile } = useUser();
|
||||
const {
|
||||
currentClass,
|
||||
timetables,
|
||||
|
||||
@ -2,11 +2,11 @@ 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 useTimetableStore from '../../stores/timetableStore';
|
||||
import { useProfile } from '../../contexts/ProfileContext';
|
||||
import { useUser } from '../../contexts/UserContext';
|
||||
|
||||
const ClassesPage: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const { profile } = useProfile();
|
||||
const { profile } = useUser();
|
||||
const {
|
||||
classes,
|
||||
totalCount,
|
||||
|
||||
@ -2,14 +2,14 @@ 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 useTimetableStore from '../../stores/timetableStore';
|
||||
import { useProfile } from '../../contexts/ProfileContext';
|
||||
import { useUser } from '../../contexts/UserContext';
|
||||
import { format, parseISO } from 'date-fns';
|
||||
import Modal from '../../components/common/Modal';
|
||||
|
||||
const LessonPage: React.FC = () => {
|
||||
const { lessonId } = useParams<{ lessonId: string }>();
|
||||
const navigate = useNavigate();
|
||||
const { profile } = useProfile();
|
||||
const { profile } = useUser();
|
||||
const {
|
||||
currentLesson,
|
||||
currentTimetable,
|
||||
|
||||
@ -2,10 +2,10 @@ import React, { useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { AccessTimeIcon, KeyboardArrowRightIcon, MenuBookIcon, PeopleIcon, SchoolIcon } from '@mui/icons-material';
|
||||
import useTimetableStore from '../../stores/timetableStore';
|
||||
import { useProfile } from '../../contexts/ProfileContext';
|
||||
import { useUser } from '../../contexts/UserContext';
|
||||
|
||||
const MyClassesPage: React.FC = () => {
|
||||
const { profile } = useProfile();
|
||||
const { profile } = useUser();
|
||||
const {
|
||||
myClasses,
|
||||
myClassesLoading,
|
||||
|
||||
@ -2,13 +2,13 @@ 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 useTimetableStore from '../../stores/timetableStore';
|
||||
import { useProfile } from '../../contexts/ProfileContext';
|
||||
import { useUser } from '../../contexts/UserContext';
|
||||
import { format, parseISO, addDays, startOfWeek, isSameDay } from 'date-fns';
|
||||
|
||||
const TimetablePage: React.FC = () => {
|
||||
const { timetableId } = useParams<{ timetableId: string }>();
|
||||
const navigate = useNavigate();
|
||||
const { profile } = useProfile();
|
||||
const { profile } = useUser();
|
||||
const {
|
||||
currentTimetable,
|
||||
currentLessons,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user