Skip to content

Commit 984b55e

Browse files
committed
Refactor FullPageForm stories
1 parent e41349c commit 984b55e

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed
Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import TextField from "@mui/material/TextField";
22
import { action } from "@storybook/addon-actions";
3-
import { ComponentMeta, Story } from "@storybook/react";
43
import { FormFooter } from "../FormFooter/FormFooter";
54
import { Stack } from "../Stack/Stack";
65
import { FullPageForm, FullPageFormProps } from "./FullPageForm";
6+
import type { Meta, StoryObj } from "@storybook/react";
77

8-
export default {
9-
title: "components/FullPageForm",
10-
component: FullPageForm,
11-
} as ComponentMeta<typeof FullPageForm>;
12-
13-
const Template: Story<FullPageFormProps> = (args) => (
14-
<FullPageForm {...args}>
8+
const Template = (props: FullPageFormProps) => (
9+
<FullPageForm {...props}>
1510
<form
1611
onSubmit={(e) => {
1712
e.preventDefault();
@@ -26,8 +21,17 @@ const Template: Story<FullPageFormProps> = (args) => (
2621
</FullPageForm>
2722
);
2823

29-
export const Example = Template.bind({});
30-
Example.args = {
31-
title: "My Form",
32-
detail: "Lorem ipsum dolor",
24+
const meta: Meta<typeof FullPageForm> = {
25+
title: "components/FullPageForm",
26+
component: Template,
27+
};
28+
29+
export default meta;
30+
type Story = StoryObj<typeof FullPageForm>;
31+
32+
export const Example: Story = {
33+
args: {
34+
title: "My Form",
35+
detail: "Lorem ipsum dolor",
36+
},
3337
};

0 commit comments

Comments
 (0)