chore: add css class
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
@use 'sass:color';
|
@use 'sass:color';
|
||||||
@use 'src/views/styles/colors.module.scss';
|
@use 'src/views/styles/colors.module.scss';
|
||||||
|
|
||||||
.dayLabelContainer {
|
.calendar {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto repeat(5, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
gap: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
height: 13px;
|
height: 13px;
|
||||||
min-width: 40px;
|
min-width: 40px;
|
||||||
min-height: 13px;
|
min-height: 13px;
|
||||||
@@ -12,9 +18,6 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
}
|
|
||||||
|
|
||||||
.dayLabel {
|
|
||||||
color: colors.$burnt_orange;
|
color: colors.$burnt_orange;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14.22px;
|
font-size: 14.22px;
|
||||||
@@ -23,14 +26,6 @@
|
|||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeAndGrid {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day {
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeBlock {
|
.timeBlock {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import CalendarCell from '../CalendarGridCell/CalendarGridCell';
|
|||||||
import { DAY_MAP } from 'src/shared/types/CourseMeeting';
|
import { DAY_MAP } from 'src/shared/types/CourseMeeting';
|
||||||
|
|
||||||
const daysOfWeek = Object.values(DAY_MAP);
|
const daysOfWeek = Object.values(DAY_MAP);
|
||||||
|
daysOfWeek.pop();
|
||||||
|
daysOfWeek.pop();
|
||||||
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
|
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
|
||||||
const grid = Array.from({ length: 5 }, () =>
|
const grid = Array.from({ length: 5 }, () =>
|
||||||
Array.from({ length: 13 }, (_, columnIndex) => <CalendarCell key={columnIndex} />)
|
Array.from({ length: 13 }, (_, columnIndex) => <CalendarCell key={columnIndex} />)
|
||||||
@@ -16,17 +18,27 @@ const grid = Array.from({ length: 5 }, () =>
|
|||||||
const Calendar: React.FC = (props) => {
|
const Calendar: React.FC = (props) => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.calendar}>
|
<div className={styles.calendar}>
|
||||||
<div className={styles.dayLabelContainer}></div>
|
|
||||||
{daysOfWeek.map((day, dayIndex) => (
|
|
||||||
<div key={dayIndex} className={styles.day}>
|
|
||||||
<div className={styles.dayLabelContainer}>
|
<div className={styles.dayLabelContainer}>
|
||||||
<div className={styles.dayLabel}>{day}</div>
|
{/* Empty cell in the top-left corner */}
|
||||||
|
<div className={styles.day} />
|
||||||
|
{/* Displaying day labels */}
|
||||||
|
{daysOfWeek.map(day => (
|
||||||
|
<div key={day} className={styles.day}>
|
||||||
|
{day}
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Displaying the rest of the calendar */}
|
||||||
{hoursOfDay.map((hour) => (
|
{hoursOfDay.map((hour) => (
|
||||||
<div key={`${day}-${hour}`} className={styles.timeBlock}>
|
<div key={hour} className={styles.row}>
|
||||||
|
{/* Hour column */}
|
||||||
<div className={styles.timeLabelContainer}>
|
<div className={styles.timeLabelContainer}>
|
||||||
<span>{hour}:00</span>
|
<span>{hour}:00</span>
|
||||||
</div>
|
</div>
|
||||||
|
{/* Calendar cells for each day */}
|
||||||
|
{daysOfWeek.map((day, dayIndex) => (
|
||||||
|
<div key={`${day}-${hour}`} className={styles.timeBlock}>
|
||||||
<CalendarCell />
|
<CalendarCell />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user