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 --- src/components/organisms/navbar/navbar.stories.tsx | 108 ++++++++------------- 1 file changed, 43 insertions(+), 65 deletions(-) (limited to 'src/components/organisms/navbar/navbar.stories.tsx') diff --git a/src/components/organisms/navbar/navbar.stories.tsx b/src/components/organisms/navbar/navbar.stories.tsx index 95b71ef..a52602e 100644 --- a/src/components/organisms/navbar/navbar.stories.tsx +++ b/src/components/organisms/navbar/navbar.stories.tsx @@ -1,77 +1,55 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Navbar as NavbarComponent } from './navbar'; +import type { Meta, StoryObj } from '@storybook/react'; +import { Navbar } from './navbar'; import { NavbarItem } from './navbar-item'; -/** - * Navbar - Storybook Meta - */ -export default { +const meta = { + component: Navbar, title: 'Organisms/Navbar', - component: NavbarComponent, - argTypes: { - children: { - description: 'The navbar items.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - }, - parameters: { - layout: 'fullscreen', - }, -} as ComponentMeta; +} satisfies Meta; -const Template: ComponentStory = (args) => ( - -); +export default meta; -/** - * Navbar Stories - 1 item - */ -export const OneItem = Template.bind({}); -OneItem.args = { - children: ( - - The main nav contents - - ), -}; +type Story = StoryObj; -/** - * Navbar Stories - 2 items - */ -export const TwoItems = Template.bind({}); -TwoItems.args = { - children: ( - <> +export const OneItem: Story = { + args: { + children: ( The main nav contents - - A search form - - - ), + ), + }, }; -/** - * Navbar Stories - 3 items - */ -export const ThreeItems = Template.bind({}); -ThreeItems.args = { - children: ( - <> - - The main nav contents - - - A search form - - - A settings form - - - ), +export const TwoItems: Story = { + args: { + children: ( + <> + + The main nav contents + + + A search form + + + ), + }, +}; + +export const ThreeItems: Story = { + args: { + children: ( + <> + + The main nav contents + + + A search form + + + A settings form + + + ), + }, }; -- cgit v1.2.3