Skip to content

Commit

Permalink
update components stories
Browse files Browse the repository at this point in the history
  • Loading branch information
adeonir committed Oct 13, 2023
1 parent 0d79b1f commit b5729fa
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
27 changes: 15 additions & 12 deletions src/components/Heading/Heading.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { ComponentMeta, ComponentStory } from '@storybook/react'
import type { Meta, StoryObj } from '@storybook/react'

import { Heading } from './Heading'

Check failure on line 3 in src/components/Heading/Heading.stories.tsx

View workflow job for this annotation

GitHub Actions / Lint

`./Heading` import should occur before type import of `@storybook/react`

export default {
const meta = {
title: 'Heading',
component: Heading,
argTypes: {
align: {
defaultValue: 'left',
},
as: {
defaultValue: 'h1',
},
parameters: {
layout: 'centered',
},
} as ComponentMeta<typeof Heading>
tags: ['autodocs'],
} satisfies Meta<typeof Heading>

const Template: ComponentStory<typeof Heading> = (args) => <Heading {...args}>Heading</Heading>
export default meta
type Story = StoryObj<typeof meta>

export const Primary = Template.bind({})
export const Default: Story = {
args: {
children: 'Heading',
align: 'left',
as: 'h1',
},
}
27 changes: 16 additions & 11 deletions src/components/Navigation/Navigation.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { ComponentMeta, ComponentStory } from '@storybook/react'
import { Meta, StoryObj } from '@storybook/react'
import { MemoryRouter } from 'react-router-dom'

import { NAV_LINKS } from '~/constants'

import { Navigation } from '.'

export default {
const meta = {
title: 'Navigation',
component: Navigation,
decorators: [
(Story) => (
<MemoryRouter>
<Story />
</MemoryRouter>
)

Check failure on line 16 in src/components/Navigation/Navigation.stories.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `,`
]

Check failure on line 17 in src/components/Navigation/Navigation.stories.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `,`
} satisfies Meta<typeof Navigation>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
args: {
links: NAV_LINKS,
},
} as ComponentMeta<typeof Navigation>

const Template: ComponentStory<typeof Navigation> = (args) => (
<MemoryRouter>
<Navigation {...args} />
</MemoryRouter>
)

export const Default = Template.bind({})
}

1 comment on commit b5729fa

@vercel
Copy link

@vercel vercel bot commented on b5729fa Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.