Skip to content

Commit fd5b5be

Browse files
committed
fix: lint
1 parent 62f9db5 commit fd5b5be

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

src/components/layout/SidebarPosition.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type SidebarContextType = {
88

99
const SidebarContext = createContext<SidebarContextType | undefined>(undefined);
1010

11-
export const SidebarProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
11+
export const SidebarProvider = ({ children }: { children: JSX.Element }) => {
1212
const [sidebarPosition, setSidebarPosition] = useState<'left' | 'right'>(() => {
1313
const storedPosition = window.localStorage.getItem("sidebar-position");
1414
return storedPosition === "left" || storedPosition === "right" ? storedPosition : "right";

src/pages/TimeTableSelector.tsx

+8-21
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import { useEffect, useContext } from 'react'
33
import { Sidebar } from '../components/planner'
44
import { Major } from '../@types'
55
import MajorContext from '../contexts/MajorContext'
6-
import CourseContext from '../contexts/CourseContext'
76
import { useSidebarContext } from '../components/layout/SidebarPosition'
87
import { SidebarProvider } from '../components/layout/SidebarPosition'
98
import PlannerSchedule from '../components/planner/schedule/PlannerSchedule'
109

1110
const TimeTableSelectorPage = () => {
12-
const {setMajors} = useContext(MajorContext);
11+
const { setMajors } = useContext(MajorContext);
1312

1413
// fetch majors when component is ready
1514
useEffect(() => {
@@ -20,21 +19,9 @@ const TimeTableSelectorPage = () => {
2019
}, [])
2120

2221
return (
23-
<MajorContext.Provider value={{ majors, setMajors }}>
24-
<CourseContext.Provider value={
25-
{
26-
pickedCourses, setPickedCourses,
27-
coursesInfo, setCoursesInfo,
28-
checkboxedCourses, setCheckboxedCourses,
29-
choosingNewCourse, setChoosingNewCourse,
30-
ucsModalOpen, setUcsModalOpen
31-
}
32-
}>
33-
<SidebarProvider>
34-
<Content />
35-
</SidebarProvider>
36-
</CourseContext.Provider>
37-
</MajorContext.Provider>
22+
<SidebarProvider>
23+
<Content />
24+
</SidebarProvider>
3825
);
3926
};
4027

@@ -43,22 +30,22 @@ const Content = () => {
4330

4431
return (
4532
<div className="grid w-full grid-cols-12 gap-x-4 gap-y-4 px-4 py-4">
46-
{sidebarPosition === 'left' ?(
33+
{sidebarPosition === 'left' ? (
4734
<>
4835
<div className='col-span-12 lg:col-span-3 min-h'>
4936
<Sidebar />
5037
</div>
5138
<div className='col-span-12 lg:col-span-9 min-h rounded-md bg-lightest px-3 py-3 dark:bg-dark 2xl:px-5 2xl:py-5'>
52-
<Schedule />
39+
<PlannerSchedule />
5340
</div>
5441
</>
5542
) : (
5643
<>
5744
<div className='col-span-12 lg:col-span-9 min-h rounded-md bg-lightest px-3 py-3 dark:bg-dark 2xl:px-5 2xl:py-5'>
58-
<Schedule />
45+
<PlannerSchedule />
5946
</div>
6047
<div className='col-span-12 lg:col-span-3 min-h'>
61-
<Sidebar />
48+
<Sidebar />
6249
</div>
6350
</>
6451
)}

0 commit comments

Comments
 (0)