Skip to content

Commit

Permalink
feat: migrate styles to TailwindCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
doprz committed Mar 6, 2024
1 parent 4dc8957 commit 7e2f5ea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@use 'sass:color';
@use 'src/views/styles/colors.module.scss';

.dayLabelContainer {
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -32,7 +29,6 @@

.day {
gap: 5px;
color: colors.$burnt_orange;
text-align: center;
font-size: 14.22px;
font-style: normal;
Expand Down
30 changes: 15 additions & 15 deletions src/views/components/common/CalendarGrid/CalendarGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import styles from './CalendarGrid.module.scss';
import CalendarCell from '../CalendarGridCell/CalendarGridCell';
import { DAY_MAP } from 'src/shared/types/CourseMeeting';

Expand All @@ -9,11 +8,12 @@ const grid = [];
for (let i = 0; i < 13; i++) {
const row = [];
let hour = hoursOfDay[i];
row.push(<>
<div key={hour} className={styles.timeBlock}>
<div className={styles.timeLabelContainer}><p>{(hour % 12 === 0 ? 12 : hour % 12) + (hour < 12 ? ' AM' : ' PM')}</p></div>
row.push(
<div key={hour} className="flex">
<div className="flex flex-col items-end">
<p className="text-left">{(hour % 12 === 0 ? 12 : hour % 12) + (hour < 12 ? ' AM' : ' PM')}</p>
</div>
</div>
</>
);
row.push(Array.from({ length: 5 }, (_, j) => <CalendarCell key={j} />));
grid.push(row);
Expand All @@ -25,26 +25,26 @@ for (let i = 0; i < 13; i++) {
*/
const Calendar: React.FC = (props) => {
return (
<div className={styles.calendar}>
<div className={styles.dayLabelContainer}>
<div className="grid grid-cols-7">
<div className="flex justify-center items-center h-13 min-w-40 min-h-13 pb-15 gap-10 flex-1">
</div>
{/* Displaying the rest of the calendar */}
<div className={styles.timeAndGrid}>
{/* <div className={styles.timeColumn}>
<div className={styles.timeBlock}></div>
<div className="flex">
{/* <div className="flex flex-col justify-between items-start flex-1">
<div className="flex"></div>
{hoursOfDay.map((hour) => (
<div key={hour} className={styles.timeBlock}>
<div className={styles.timeLabelContainer}>
<div key={hour} className="flex">
<div className="flex flex-col items-end">
<p>{hour % 12 === 0 ? 12 : hour % 12} {hour < 12 ? 'AM' : 'PM'}</p>
</div>
</div>
))}
</div> */}
<div className={styles.calendarGrid}>
<div className="grid grid-cols-6 grid-rows-13">
{/* Displaying day labels */}
<div className={styles.timeBlock}></div>
<div className="flex"></div>
{daysOfWeek.map(day => (
<div key={day} className={styles.day}>
<div key={day} className="border border-solid border-gray-300 text-center">
{day}
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React from 'react';
import styles from './CalendarGridCell.module.scss';

/**
* Component representing each 1 hour time block of a calendar
* @param props
*/
const CalendarCell: React.FC = (props) => {
return (
<div className={styles.calendarCell}>
<div className={styles.hourLine}>

</div>
<div className="flex w-56 h-12 min-w-12 min-h-10 flex-col justify-center items-start border border-gray-300">
<div className="w-full h-1 border-none rounded-none bg-gray-300 bg-opacity-25"></div>
</div>
);
};
Expand Down

0 comments on commit 7e2f5ea

Please sign in to comment.