diff --git a/src/stories/components/CalendarCourseCell.stories.tsx b/src/stories/components/CalendarCourseCell.stories.tsx index c1ecdb3c..da37edf1 100644 --- a/src/stories/components/CalendarCourseCell.stories.tsx +++ b/src/stories/components/CalendarCourseCell.stories.tsx @@ -44,7 +44,7 @@ export const Default: Story = {}; export const Variants: Story = { render: props => ( -
+
; - + argTypes: { + saturdayClass: { control: 'boolean' }, + }, +} satisfies Meta; export default meta; + type Story = StoryObj; -export const Default: Story = {}; \ No newline at end of file +export const Default: Story = { + args: { + saturdayClass: true, + }, +}; \ No newline at end of file diff --git a/src/stories/components/CalendarHeader.stories.tsx b/src/stories/components/CalendarHeader.stories.tsx new file mode 100644 index 00000000..6833b7b1 --- /dev/null +++ b/src/stories/components/CalendarHeader.stories.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { Meta, StoryObj } from '@storybook/react'; +import CalendarHeader from '@views/components/common/CalendarHeader/CalenderHeader'; + +const meta = { + title: 'Components/CalendarHeader', + component: CalendarHeader, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/src/views/components/common/CalendarCourseCell/CalendarCourseCell.tsx b/src/views/components/common/CalendarCourseCell/CalendarCourseCell.tsx index e7b389f6..a26ed432 100644 --- a/src/views/components/common/CalendarCourseCell/CalendarCourseCell.tsx +++ b/src/views/components/common/CalendarCourseCell/CalendarCourseCell.tsx @@ -1,4 +1,6 @@ -import { Status } from '@shared/types/Course'; +import { Course, Status } from '@shared/types/Course'; +import { CourseMeeting } from '@shared/types/CourseMeeting'; +import clsx from 'clsx'; import React from 'react'; import { CourseColors, pickFontColor } from 'src/shared/util/colors'; import ClosedIcon from '~icons/material-symbols/lock'; @@ -38,12 +40,17 @@ const CalendarCourseCell: React.FC = ({ backgroundColor: colors.primaryColor, }} > -
- - {courseDeptAndInstr} +
+ + {course.department} {course.number} - {course.instructors[0].lastName} {timeAndLocation && ( - + {timeAndLocation} )} diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.tsx b/src/views/components/common/CalendarGrid/CalendarGrid.tsx index 3d83ef9a..0bd85c10 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.tsx +++ b/src/views/components/common/CalendarGrid/CalendarGrid.tsx @@ -2,7 +2,8 @@ import React from 'react'; import { DAY_MAP } from 'src/shared/types/CourseMeeting'; import styles from './CalendarGrid.module.scss'; import CalendarCell from '../CalendarGridCell/CalendarGridCell'; -import { CourseMeeting } from 'src/shared/types/CourseMeeting'; +import CalendarCourseCell from '../CalendarCourseCell/CalendarCourseCell'; +import { Chip } from '../Chip/Chip'; const daysOfWeek = Object.keys(DAY_MAP).filter(key => !['S', 'SU'].includes(key)); const hoursOfDay = Array.from({ length: 14 }, (_, index) => index + 8); @@ -22,15 +23,15 @@ for (let i = 0; i < 13; i++) { } interface Props { - CourseMeetingBlocks: CourseMeeting[]; + courseCells: any[]; + saturdayClass: boolean; } /** * Grid of CalendarGridCell components forming the user's course schedule calendar view * @param props */ -export function Calendar({ courseMeetingBlocks }: React.PropsWithChildren): JSX.Element { - +function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren ): JSX.Element { return (
@@ -54,16 +55,22 @@ export function Calendar({ courseMeetingBlocks }: React.PropsWithChildren {day}
))} - {grid.map((row, rowIndex) => row)} + {grid.map(row => row)}
- {courseMeetingBlocks.map((block: CourseMeeting, index: number) => ( -
- {block} + {/* courseCells.map((Block: typeof CalendarCourseCell) => ( +
+
- ))} + )) */}
); -}; +} -export default Calendar; +export default CalendarGrid; diff --git a/src/views/components/common/CalendarHeader/CalenderHeader.tsx b/src/views/components/common/CalendarHeader/CalenderHeader.tsx new file mode 100644 index 00000000..b5d07274 --- /dev/null +++ b/src/views/components/common/CalendarHeader/CalenderHeader.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { Status } from '@shared/types/Course'; +import Divider from '../Divider/Divider'; +import { Button } from '../Button/Button'; +import Text from '../Text/Text'; +import MenuIcon from '~icons/material-symbols/menu'; +import LogoIcon from '~icons/material-symbols/add-circle-outline'; +import UndoIcon from '~icons/material-symbols/undo'; +import RedoIcon from '~icons/material-symbols/redo'; +import SettingsIcon from '~icons/material-symbols/settings'; +import ScheduleTotalHoursAndCourses from '../ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses'; +import CourseStatus from '../CourseStatus/CourseStatus'; + +const CalendarHeader = () => ( +
+
+ +
+); + +export default CalendarHeader; diff --git a/src/views/components/common/PopupCourseBlock/PopupCourseBlock.tsx b/src/views/components/common/PopupCourseBlock/PopupCourseBlock.tsx index 2d703caa..0f70d025 100644 --- a/src/views/components/common/PopupCourseBlock/PopupCourseBlock.tsx +++ b/src/views/components/common/PopupCourseBlock/PopupCourseBlock.tsx @@ -1,8 +1,8 @@ -import clsx from 'clsx'; -import React, { useState } from 'react'; import { Course, Status } from '@shared/types/Course'; +import { CourseColors, pickFontColor } from '@shared/util/colors'; import { StatusIcon } from '@shared/util/icons'; -import { CourseColors, getCourseColors, pickFontColor } from '@shared/util/colors'; +import clsx from 'clsx'; +import React from 'react'; import DragIndicatorIcon from '~icons/material-symbols/drag-indicator'; import Text from '../Text/Text'; @@ -21,7 +21,12 @@ export interface PopupCourseBlockProps { * * @param props PopupCourseBlockProps */ -export default function PopupCourseBlock({ className, course, colors, dragHandleProps }: PopupCourseBlockProps): JSX.Element { +export default function PopupCourseBlock({ + className, + course, + colors, + dragHandleProps, +}: PopupCourseBlockProps): JSX.Element { // whiteText based on secondaryColor const fontColor = pickFontColor(colors.primaryColor); @@ -41,10 +46,7 @@ export default function PopupCourseBlock({ className, course, colors, dragHandle >
- + {course.uniqueId} {course.department} {course.number} –{' '} {course.instructors.length === 0 ? 'Unknown' : course.instructors.map(v => v.lastName)} diff --git a/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx b/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx index 72d7782a..fd91d1f7 100644 --- a/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx +++ b/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx @@ -15,27 +15,19 @@ export interface ScheduleTotalHoursAndCoursesProps { * * @param props ScheduleTotalHoursAndCoursesProps */ -export default function ScheduleTotalHoursAndCoursess({ scheduleName, totalHours, totalCourses }: ScheduleTotalHoursAndCoursesProps): JSX.Element { +export default function ScheduleTotalHoursAndCourses({ + scheduleName, + totalHours, + totalCourses, +}: ScheduleTotalHoursAndCoursesProps): JSX.Element { return ( -
- +
+ {`${scheduleName}: `} - + {`${totalHours} HOURS`} - + {`${totalCourses} courses`}