From 7a014a7aabc57ae506c8f46cc97aa2cf758d9459 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Mon, 5 Feb 2024 21:33:40 -0600 Subject: [PATCH] Screams in Stylesheets --- .../CalendarGrid/CalendarGrid.module.scss | 37 ++++++++----------- .../common/CalendarGrid/CalendarGrid.tsx | 30 ++++++++++----- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss index 6f1cf6c8..630fa7d5 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss +++ b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss @@ -1,28 +1,6 @@ @use 'sass:color'; @use 'src/views/styles/colors.module.scss'; -.dayLabelContainer { - display: flex; - height: 13px; - min-width: 40px; - min-height: 13px; - padding-bottom: 15px; - justify-content: center; - align-items: center; - gap: 10px; - flex: 1 0 0; -} - -.dayLabel { - color: colors.$burnt_orange; - text-align: center; - font-family: Roboto; - font-size: 14.22px; - font-style: normal; - font-weight: 500; - line-height: normal; -} - .calendar { display: grid; grid-template-columns: auto repeat(5, 1fr); @@ -31,6 +9,21 @@ .day { gap: 5px; + display: flex; + height: 13px; + min-width: 40px; + min-height: 13px; + padding-bottom: 15px; + justify-content: center; + align-items: center; + gap: 10px; + flex: 1 0 0; + color: colors.$burnt_orange; + text-align: center; + font-size: 14.22px; + font-style: normal; + font-weight: 500; + line-height: normal; } .timeBlock { diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.tsx b/src/views/components/common/CalendarGrid/CalendarGrid.tsx index 4896108a..9c7bd140 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.tsx +++ b/src/views/components/common/CalendarGrid/CalendarGrid.tsx @@ -4,6 +4,8 @@ import CalendarCell from '../CalendarGridCell/CalendarGridCell'; import { DAY_MAP } from 'src/shared/types/CourseMeeting'; const daysOfWeek = Object.values(DAY_MAP); +daysOfWeek.pop(); +daysOfWeek.pop(); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); /** @@ -13,17 +15,27 @@ const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); const Calendar: React.FC = (props) => { return (
-
- {daysOfWeek.map((day, dayIndex) => ( -
-
-
{day}
+
+ {/* Empty cell in the top-left corner */} +
+ {/* Displaying day labels */} + {daysOfWeek.map(day => ( +
+ {day}
- {hoursOfDay.map((hour) => ( + ))} +
+ + {/* Displaying the rest of the calendar */} + {hoursOfDay.map((hour) => ( +
+ {/* Hour column */} +
+ {hour}:00 +
+ {/* Calendar cells for each day */} + {daysOfWeek.map((day, dayIndex) => (
-
- {hour}:00 -
))}