chore: add courseCells and improve types

This commit is contained in:
knownotunknown
2024-02-17 15:03:18 -06:00
committed by doprz
parent d1a336e903
commit 5ad72af566
2 changed files with 7 additions and 6 deletions

View File

@@ -1,9 +1,10 @@
import React from 'react'; import React from 'react';
import { DAY_MAP } from 'src/shared/types/CourseMeeting'; import { DAY_MAP } from 'src/shared/types/CourseMeeting';
import styles from './CalendarGrid.module.scss';
import CalendarCell from '../CalendarGridCell/CalendarGridCell'; import CalendarCell from '../CalendarGridCell/CalendarGridCell';
import { CalendarGridCourse } from 'src/views/hooks/useFlattenedCourseSchedule';
import CalendarCourseCell from '../CalendarCourseCell/CalendarCourseCell'; import CalendarCourseCell from '../CalendarCourseCell/CalendarCourseCell';
import { Chip } from '../Chip/Chip'; import { Chip } from '../Chip/Chip';
import styles from './CalendarGrid.module.scss';
const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['S', 'SU'].includes(key)); const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['S', 'SU'].includes(key));
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
@@ -23,7 +24,7 @@ for (let i = 0; i < 13; i++) {
} }
interface Props { interface Props {
courseCells: any[]; courseCells: CalendarGridCourse[];
saturdayClass: boolean; saturdayClass: boolean;
} }
@@ -58,7 +59,7 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
{grid.map(row => row)} {grid.map(row => row)}
</div> </div>
</div> </div>
{/* courseCells.map((Block: typeof CalendarCourseCell) => ( {courseCells.map((Block: typeof CalendarCourseCell) => (
<div <div
key={`${Block}`} key={`${Block}`}
style={{ style={{
@@ -66,9 +67,9 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
gridRow: `1`, gridRow: `1`,
}} }}
> >
<Chip label='test' /> <CalendarCourseCell courseDeptAndInstr={} />
</div> </div>
)) */} ))}
</div> </div>
); );
} }

View File

@@ -15,7 +15,7 @@ interface CalendarGridPoint {
endIndex: number; endIndex: number;
} }
interface SomeObject { export interface CalendarGridCourse {
calendarGridPoint?: CalendarGridPoint; calendarGridPoint?: CalendarGridPoint;
componentProps: CalendarCourseCellProps; componentProps: CalendarCourseCellProps;
} }