feat: update dialog component to headlessui (#159)

This commit is contained in:
Razboy20
2024-03-13 23:09:43 -05:00
committed by GitHub
parent df7a7c65d6
commit 442be8cbee
8 changed files with 149 additions and 170 deletions

View File

@@ -3,6 +3,7 @@ import { Status } from '@shared/types/Course';
import { UserSchedule } from '@shared/types/UserSchedule';
import type { Meta, StoryObj } from '@storybook/react';
import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup';
import React, { useState } from 'react';
import { bevoCourse, bevoScheule, MikeScottCS314Course, MikeScottCS314Schedule } from './mocked';
@@ -10,6 +11,7 @@ const meta = {
title: 'Components/Injected/CourseCatalogInjectedPopup',
component: CourseCatalogInjectedPopup,
args: {
open: true,
onClose: () => {},
},
argTypes: {
@@ -29,6 +31,12 @@ const meta = {
},
},
},
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;