Calendar Components 3rd Attempt at Merging
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
:root {
|
||||||
|
--Primary-Colors-Burnt-Orange: #BF5700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day-label-container {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day-label {
|
||||||
|
color: var(--Primary-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);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.day {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto repeat(14, 1fr);
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-block {
|
||||||
|
display: flex;
|
||||||
|
width: 50px;
|
||||||
|
height: 40.279px;
|
||||||
|
min-width: 50px;
|
||||||
|
max-width: 50px;
|
||||||
|
min-height: 40px;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-label-container {
|
||||||
|
display: flex;
|
||||||
|
max-height: 20px;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
gap: 17px;
|
||||||
|
flex: 1 0 0;
|
||||||
|
align-self: stretch;
|
||||||
|
border-radius: var(--border-radius-none, 0px);
|
||||||
|
}
|
||||||
31
src/views/components/common/CalendarGrid/CalendarGrid.tsx
Normal file
31
src/views/components/common/CalendarGrid/CalendarGrid.tsx
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styles from './CalendarGrid.module.scss';
|
||||||
|
import CalendarCell from '../CalendarGridCell/CalendarGridCell';
|
||||||
|
|
||||||
|
const Calendar: React.FC = () => {
|
||||||
|
const daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
|
||||||
|
const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="calendar">
|
||||||
|
<div className="day-label-container"></div>
|
||||||
|
{daysOfWeek.map((day, dayIndex) => (
|
||||||
|
<div key={dayIndex} className="day">
|
||||||
|
<div className="day-label-container">
|
||||||
|
<div className="day-label">{day}</div>
|
||||||
|
</div>
|
||||||
|
{hoursOfDay.map((hour) => (
|
||||||
|
<div key={`${day}-${hour}`} className="time-block">
|
||||||
|
<div className="time-label-container">
|
||||||
|
<span>{hour}:00</span>
|
||||||
|
</div>
|
||||||
|
<CalendarCell />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Calendar;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
.calendar-cell {
|
||||||
|
display: flex;
|
||||||
|
width: 165px;
|
||||||
|
height: 52.231px;
|
||||||
|
min-width: 45px;
|
||||||
|
min-height: 40px;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hour-line {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
border-top: 1px solid black; /* Adjust line styles as needed */
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styles from './CalendarGridCell.module.scss';
|
||||||
|
|
||||||
|
const CalendarCell: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div className={styles['calendar-cell']}>
|
||||||
|
<div className={styles['hour-line']}></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CalendarCell;
|
||||||
Reference in New Issue
Block a user