fix(breadcrumb-stories): add examples and router decorator

This commit is contained in:
RadoslavDimchev 2024-04-29 22:47:45 +03:00 committed by Emil Ivanichkov
parent 21e98a5b8d
commit 146fc44b46
3 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6'
import Breadcrumb from './Breadcrumb'
@ -8,6 +9,7 @@ const meta = {
parameters: {
layout: 'top',
},
decorators: [withRouter()],
tags: ['autodocs'],
} satisfies Meta<typeof Breadcrumb>

View File

@ -1,4 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6'
import BreadcrumbElement from './BreadcrumbElement'
@ -8,6 +9,7 @@ const meta = {
parameters: {
layout: 'top',
},
decorators: [withRouter()],
tags: ['autodocs'],
} satisfies Meta<typeof BreadcrumbElement>
@ -16,14 +18,16 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
element: 'Nodes',
breadcrumb: 'Nodes',
match: { pathname: '/nodes' },
isLastElement: false,
},
}
export const LastElement: Story = {
args: {
element: 'Nodes',
breadcrumb: 'Nodes',
match: { pathname: '/nodes' },
isLastElement: true,
},
}

View File

@ -16,7 +16,6 @@ const BreadcrumbElement = ({
return (
<XStack space={'$2'} alignItems="flex-end">
<NavLink
key={match.pathname}
to={match.pathname}
style={{
textDecoration: 'none',