From 0f936ec0e7606cb79434d94096b6e113a7ce78eb Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 15 Dec 2023 18:35:16 +0100 Subject: refactor(stories): migrate stories to CSF3 format --- .../forms/contact-form/contact-form.stories.ts | 23 ++++++++++++++ .../forms/contact-form/contact-form.stories.tsx | 35 ---------------------- 2 files changed, 23 insertions(+), 35 deletions(-) create mode 100644 src/components/organisms/forms/contact-form/contact-form.stories.ts delete mode 100644 src/components/organisms/forms/contact-form/contact-form.stories.tsx (limited to 'src/components/organisms/forms/contact-form') diff --git a/src/components/organisms/forms/contact-form/contact-form.stories.ts b/src/components/organisms/forms/contact-form/contact-form.stories.ts new file mode 100644 index 0000000..cd2cd1b --- /dev/null +++ b/src/components/organisms/forms/contact-form/contact-form.stories.ts @@ -0,0 +1,23 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { ContactForm, type ContactFormSubmit } from './contact-form'; + +const meta = { + component: ContactForm, + title: 'Organisms/Forms/Contact', +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +const sendMail: ContactFormSubmit = () => { + console.log('Mail sent!'); + + return undefined; +}; + +export const Example: Story = { + args: { + onSubmit: sendMail, + }, +}; diff --git a/src/components/organisms/forms/contact-form/contact-form.stories.tsx b/src/components/organisms/forms/contact-form/contact-form.stories.tsx deleted file mode 100644 index 46111e1..0000000 --- a/src/components/organisms/forms/contact-form/contact-form.stories.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { ContactForm } from './contact-form'; - -/** - * ContactForm - Storybook Meta - */ -export default { - title: 'Organisms/Forms', - component: ContactForm, - argTypes: { - onSubmit: { - control: { - type: null, - }, - description: 'A callback function to process the contact form data.', - table: { - category: 'Events', - }, - type: { - name: 'function', - required: false, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -/** - * ContactForm Stories - Contact - */ -export const Contact = Template.bind({}); -Contact.args = {}; -- cgit v1.2.3