Skip to content

Commit

Permalink
wip: add nav-bar components
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 29, 2024
1 parent bef818e commit 64187e5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/stories/components/nav-bar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Meta, StoryObj } from '@storybook/react'
import { useLocation, useNavigate } from 'react-router-dom'
import { NavBar } from '../../components'

const meta: Meta<typeof NavBar> = {
title: 'Components/Nav Bar',
component: NavBar,
}

export default meta
type Story = StoryObj<typeof NavBar>

export const Default: Story = {
args: {
items: [
{
href: '/',
title: 'Workspaces',
},
{
href: '/group',
title: 'Groups',
},
{
href: '/organizations',
title: 'Organizations',
},
],
},
render: (args) => {
const location = useLocation()
const navigate = useNavigate()

return (
<NavBar
{...args}
pathnameFn={() => location.pathname}
navigateFn={navigate}
/>
)
},
}

0 comments on commit 64187e5

Please sign in to comment.