diff --git a/src/stories/components/CalendarGrid.stories.tsx b/src/stories/components/CalendarGrid.stories.tsx index 6d8861b9..881ff93d 100644 --- a/src/stories/components/CalendarGrid.stories.tsx +++ b/src/stories/components/CalendarGrid.stories.tsx @@ -1,19 +1,25 @@ -// Calendar.stories.tsx -import React from 'react'; -import Calendar from '@views/components/common/CalendarGrid/CalendarGrid'; -import type { Meta, StoryObj } from '@storybook/react'; +import { Meta, StoryObj } from '@storybook/react'; +import CalendarGrid from 'src/views/components/common/CalendarGrid/CalendarGrid'; const meta = { - title: 'Components/Common/Calendar', - component: Calendar, - parameters: { - // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout - layout: 'centered', + title: 'Components/Common/CalendarGrid', + component: CalendarGrid, + parameters: { + layout: 'centered', + }, tags: ['autodocs'], - } -} satisfies Meta; - + argTypes: { + saturday: { control: 'text' }, + sunday: { control: 'text' }, + }, +} satisfies Meta; export default meta; + type Story = StoryObj; -export const Default: Story = {}; \ No newline at end of file +export const Default: Story = { + args: { + saturday: true, + sunday: true, + }, +}; \ No newline at end of file diff --git a/src/views/components/common/CalendarGrid/CalendarGrid.tsx b/src/views/components/common/CalendarGrid/CalendarGrid.tsx index 4dbd06c9..0bd85c10 100644 --- a/src/views/components/common/CalendarGrid/CalendarGrid.tsx +++ b/src/views/components/common/CalendarGrid/CalendarGrid.tsx @@ -5,7 +5,6 @@ import CalendarCell from '../CalendarGridCell/CalendarGridCell'; 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); const grid = []; @@ -24,15 +23,15 @@ for (let i = 0; i < 13; i++) { } interface Props { - courseCells: typeof CalendarCourseCell[]; + courseCells: any[]; + saturdayClass: boolean; } /** * Grid of CalendarGridCell components forming the user's course schedule calendar view * @param props */ -export function Calendar({ courseCells }: React.PropsWithChildren): JSX.Element { - +function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren ): JSX.Element { return (
@@ -56,20 +55,22 @@ export function Calendar({ courseCells }: React.PropsWithChildren): JSX.E {day}
))} - {grid.map((row) => row)} + {grid.map(row => row)}
- {courseCells.map((Block: typeof CalendarCourseCell) => ( -
- + {/* courseCells.map((Block: typeof CalendarCourseCell) => ( +
+
- ))} + )) */}
); -}; +} -export default Calendar; +export default CalendarGrid;