diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss index d2e180b2..41909207 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.module.scss +++ b/src/views/components/common/CalendarGrid/CalendarGrid.module.scss @@ -15,8 +15,10 @@ } .calendarGrid { - display: flex; - flex-direction: column; + display: grid; + grid-template-columns: repeat(5, 1fr); + grid-template-rows: repeat(13, 1fr); + grid-gap: 8px; } .calendarRow { diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.tsx b/src/views/components/common/CalendarGrid/CalendarGrid.tsx index 95226ce1..df959462 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.tsx +++ b/src/views/components/common/CalendarGrid/CalendarGrid.tsx @@ -7,8 +7,8 @@ const daysOfWeek = Object.values(DAY_MAP); daysOfWeek.pop(); daysOfWeek.pop(); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); -const grid = Array.from({ length: 13 }, () => - Array.from({ length: 5 }, (_, columnIndex) => ( +const grid = Array.from({ length: 5 }, () => + Array.from({ length: 13 }, (_, columnIndex) => ( )) ); @@ -31,21 +31,14 @@ const Calendar: React.FC = (props) => { ))} {/* Displaying the rest of the calendar */} - {/*
- {hoursOfDay.map(hour => ( -
- {daysOfWeek.map(day => ( - - ))} +
+ {grid.map((row, rowIndex) => ( +
+ {row}
))} -
*/} +
- {grid.map((row, rowIndex) => ( -
- {row} -
- ))}
) };