diff --git a/src/views/components/calendar/Calendar.tsx b/src/views/components/calendar/Calendar.tsx index 0715cf75..f2402e9c 100644 --- a/src/views/components/calendar/Calendar.tsx +++ b/src/views/components/calendar/Calendar.tsx @@ -140,7 +140,7 @@ export default function Calendar(): JSX.Element { // scrollbarGutter: 'stable', } } - className='h-full flex flex-grow flex-col overflow-x-scroll px-spacing-5' + className='z-1 h-full flex flex-grow flex-col overflow-x-scroll [&>*]:px-spacing-5' > -
+
diff --git a/src/views/components/calendar/CalendarGrid.tsx b/src/views/components/calendar/CalendarGrid.tsx index fd97ba6b..938e188e 100644 --- a/src/views/components/calendar/CalendarGrid.tsx +++ b/src/views/components/calendar/CalendarGrid.tsx @@ -3,7 +3,7 @@ import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell'; import Text from '@views/components/common/Text/Text'; import { ColorPickerProvider } from '@views/contexts/ColorPickerContext'; import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule'; -import React from 'react'; +import React, { Fragment } from 'react'; import CalendarCell from './CalendarGridCell'; @@ -30,13 +30,13 @@ function makeGridRow(row: number, cols: number): JSX.Element { const hour = hoursOfDay[row]!; return ( - <> +
{[...Array(cols).keys()].map(col => ( ))} - + ); } @@ -56,23 +56,40 @@ export default function CalendarGrid({ setCourse, }: React.PropsWithChildren): JSX.Element { return ( -
+
+ {/* Cover top left corner of grid, so time gets cut off at the top of the partial border */} +
{/* Displaying day labels */} -
-
{daysOfWeek.map(day => ( -
- - {day} - +
+ {/* Partial border height because that's what Isaiah wants */} +
+ {/* Alignment for text */} +
+ + {day} + +
+
))} + {/* empty slot, for alignment */} +
+ {/* time tick for the first hour */} +
{[...Array(13).keys()].map(i => makeGridRow(i, 5))} {Array(6) .fill(1) - .map(() => ( -
+ .map((_, i) => ( + // Key suppresses warning about duplicate keys, + // and index is fine because it doesn't change between renders + // eslint-disable-next-line react/no-array-index-key +
))} {courseCells && } diff --git a/src/views/components/calendar/CalendarGridCell.tsx b/src/views/components/calendar/CalendarGridCell.tsx index 334e0151..a010872a 100644 --- a/src/views/components/calendar/CalendarGridCell.tsx +++ b/src/views/components/calendar/CalendarGridCell.tsx @@ -17,8 +17,8 @@ function CalendarCell({ row, col }: Props): JSX.Element {
diff --git a/src/views/components/calendar/CalendarHeader/CalendarHeader.tsx b/src/views/components/calendar/CalendarHeader/CalendarHeader.tsx index b4e7f314..8990cb56 100644 --- a/src/views/components/calendar/CalendarHeader/CalendarHeader.tsx +++ b/src/views/components/calendar/CalendarHeader/CalendarHeader.tsx @@ -27,7 +27,7 @@ export default function CalendarHeader({ sidebarOpen, onSidebarToggle }: Calenda return (
{!sidebarOpen && (