Files
UT-Registration-Plus/src/stories/injected/CourseCatalogInjectedPopup.stories.tsx
Razboy20 85769e9d2c refactor(UserSchedule): index by a unique id rather than name (#166)
* refactor(UserSchedule): index by a unique id rather than name

* refactor: Update parameter names in schedule function jsdocs

* refactor: change more instances of .name to .id

* refactor: Fix typo in variable name and update references

* refactor: Remove console.log statement

* fix(chromatic): Update ScheduleListItem story

* refactor: remove unused eslint rule
2024-03-14 23:09:04 -05:00

48 lines
1.3 KiB
TypeScript

import type { Course } from '@shared/types/Course';
import { Status } from '@shared/types/Course';
import type { Meta, StoryObj } from '@storybook/react';
import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
import React, { useState } from 'react';
import { bevoCourse, mikeScottCS314Course } from './mocked';
const meta = {
title: 'Components/Injected/CourseCatalogInjectedPopup',
component: CourseCatalogInjectedPopup,
args: {
open: true,
onClose: () => {},
},
tags: ['autodocs'],
render(args) {
// eslint-disable-next-line react-hooks/rules-of-hooks
const [isOpen, setIsOpen] = useState(args.open);
return <CourseCatalogInjectedPopup {...args} open={isOpen} onClose={() => setIsOpen(false)} />;
},
} satisfies Meta<typeof CourseCatalogInjectedPopup>;
export default meta;
type Story = StoryObj<typeof meta>;
export const OpenCourse: Story = {
args: {
course: mikeScottCS314Course,
},
};
export const ClosedCourse: Story = {
args: {
course: {
...mikeScottCS314Course,
status: Status.CLOSED,
} as Course,
},
};
export const CourseWithNoData: Story = {
args: {
course: bevoCourse,
},
};