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 --- .../templates/page/page-footer.stories.tsx | 58 +++++++++------------- 1 file changed, 24 insertions(+), 34 deletions(-) (limited to 'src/components/templates/page/page-footer.stories.tsx') diff --git a/src/components/templates/page/page-footer.stories.tsx b/src/components/templates/page/page-footer.stories.tsx index aee8979..5c72583 100644 --- a/src/components/templates/page/page-footer.stories.tsx +++ b/src/components/templates/page/page-footer.stories.tsx @@ -1,41 +1,31 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Page } from './page'; -import { PageFooter } from './page-footer'; +import { PageFooter, type PageFooterProps } from './page-footer'; -/** - * PageFooter - Storybook Meta - */ -export default { - title: 'Templates/Page/Footer', - component: PageFooter, - argTypes: { - readMoreAbout: { - control: { - type: null, - }, - description: 'An array of page links.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( +const WrappedPageFooter = (props: PageFooterProps) => ( - + ); -/** - * PageFooter Stories - Footer - */ -export const Footer = Template.bind({}); -Footer.args = { - readMoreAbout: [ - { id: 1, name: 'Topic 1', url: '#topic1' }, - { id: 2, name: 'Topic 2', url: '#topic2' }, - ], +const meta = { + component: PageFooter, + title: 'Templates/Page/PageFooter', + render: WrappedPageFooter, + parameters: { + layout: 'fullscreen', + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Example: Story = { + args: { + readMoreAbout: [ + { id: 1, name: 'Topic 1', url: '#topic1' }, + { id: 2, name: 'Topic 2', url: '#topic2' }, + ], + }, }; -- cgit v1.2.3