-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
|
||
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', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
] | ||
} 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({}) | ||
} |
b5729fa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
boilerplate-react-vite – ./
boilerplate-react-vite-git-main-adeonir.vercel.app
boilerplate-react-vite.vercel.app
boilerplate-react-vite-adeonir.vercel.app