diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 2f85574..ffe6fae 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -1,8 +1,10 @@ import { Button } from '@nextui-org/react'; import clsx from 'clsx'; +import { YEAR } from '../constants/year'; import { useCourseColor } from '../data/enrolled-courses'; import { useCalendar } from '../helpers/calendar'; +import type dayjs from '../lib/dayjs'; import type { WeekCourse } from '../types/course'; const CourseCard = ({ @@ -34,28 +36,49 @@ const CourseCard = ({ ); }; +type CalendarHeaderProps = { + currentWeek: dayjs.Dayjs; + nextWeek: () => void; + prevWeek: () => void; +}; +const CalendarHeader = ({ + currentWeek, + nextWeek, + prevWeek, +}: CalendarHeaderProps) => { + return ( +
+

+ {currentWeek.format('MMMM')} + {YEAR} +

+
+ + +
+
+ ); +}; + export const Calendar = () => { const { courses, currentWeek, nextWeek, prevWeek } = useCalendar(); return (
-

{currentWeek.format('MMMM D, YYYY')}

- - + {Object.entries(courses).map(([day, dayCourses]) => (

{day}