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 --- .../organisms/nav/main-nav/main-nav.stories.tsx | 107 +++++++++------------ 1 file changed, 45 insertions(+), 62 deletions(-) (limited to 'src/components/organisms/nav/main-nav/main-nav.stories.tsx') diff --git a/src/components/organisms/nav/main-nav/main-nav.stories.tsx b/src/components/organisms/nav/main-nav/main-nav.stories.tsx index 6333f2c..c18d0d5 100644 --- a/src/components/organisms/nav/main-nav/main-nav.stories.tsx +++ b/src/components/organisms/nav/main-nav/main-nav.stories.tsx @@ -1,71 +1,54 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Icon } from '../../../atoms'; import { MainNav } from './main-nav'; -/** - * MainNav - Storybook Meta - */ -export default { - title: 'Organisms/Nav/MainNav', +const meta = { component: MainNav, - argTypes: { - items: { - description: 'The main nav items.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - }, -} as ComponentMeta; + title: 'Organisms/Nav/MainNav', +} satisfies Meta; + +export default meta; -const Template: ComponentStory = (args) => ( - -); +type Story = StoryObj; -/** - * MainNav Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - items: [ - { id: 'home', label: 'Home', href: '#home' }, - { id: 'blog', label: 'Blog', href: '#blog' }, - { id: 'projects', label: 'Projects', href: '#projects' }, - { id: 'contact', label: 'Contact', href: '#contact' }, - ], +export const Example: Story = { + args: { + items: [ + { id: 'home', label: 'Home', href: '#home' }, + { id: 'blog', label: 'Blog', href: '#blog' }, + { id: 'projects', label: 'Projects', href: '#projects' }, + { id: 'contact', label: 'Contact', href: '#contact' }, + ], + }, }; -/** - * MainNav Stories - WithLogo - */ -export const WithLogo = Template.bind({}); -WithLogo.args = { - items: [ - { - id: 'home', - label: 'Home', - href: '#home', - logo: , - }, - { - id: 'blog', - label: 'Blog', - href: '#blog', - logo: , - }, - { - id: 'projects', - label: 'Projects', - href: '#projects', - logo: , - }, - { - id: 'contact', - label: 'Contact', - href: '#contact', - logo: , - }, - ], +export const WithLogo: Story = { + args: { + items: [ + { + id: 'home', + label: 'Home', + href: '#home', + logo: , + }, + { + id: 'blog', + label: 'Blog', + href: '#blog', + logo: , + }, + { + id: 'projects', + label: 'Projects', + href: '#projects', + logo: , + }, + { + id: 'contact', + label: 'Contact', + href: '#contact', + logo: , + }, + ], + }, }; -- cgit v1.2.3