refactor(storybook): update left sidebar, dashboard, logs stories

This commit is contained in:
Hristo Nedelkov 2024-03-07 13:22:18 +02:00 committed by Emil Ivanichkov
parent 6072f8bc55
commit 2930f2aebc
4 changed files with 12 additions and 100 deletions

View File

@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react' import type { Meta, StoryObj } from '@storybook/react'
import LeftSidebar from './LeftSidebar' import LeftSidebar from './LeftSidebar'
import { withRouter } from 'storybook-addon-react-router-v6'
const meta = { const meta = {
title: 'General/LeftSidebar', title: 'General/LeftSidebar',
@ -9,6 +10,7 @@ const meta = {
layout: 'centered', layout: 'centered',
}, },
tags: ['autodocs'], tags: ['autodocs'],
decorators: [withRouter],
} satisfies Meta<typeof LeftSidebar> } satisfies Meta<typeof LeftSidebar>
export default meta export default meta

View File

@ -1,16 +1,8 @@
import type { Meta, StoryObj } from '@storybook/react' import type { Meta, StoryObj } from '@storybook/react'
import { import { DashboardIcon } from '@status-im/icons'
DashboardIcon,
SpeedIcon,
ChartIcon,
HeartIcon,
CodeBlockIcon,
CommunitiesIcon,
ActivityCenterIcon,
SettingsIcon,
} from '@status-im/icons'
import LeftSidebarIconButton from './LeftSidebarIconButton' import LeftSidebarIconButton from './LeftSidebarIconButton'
import { withRouter } from 'storybook-addon-react-router-v6'
const meta = { const meta = {
title: 'General/LeftSidebarIconButton', title: 'General/LeftSidebarIconButton',
@ -19,6 +11,7 @@ const meta = {
layout: 'centered', layout: 'centered',
}, },
tags: ['autodocs'], tags: ['autodocs'],
decorators: [withRouter],
} satisfies Meta<typeof LeftSidebarIconButton> } satisfies Meta<typeof LeftSidebarIconButton>
export default meta export default meta
@ -31,6 +24,7 @@ export const Default: Story = {
isSelected: false, isSelected: false,
isDisabled: false, isDisabled: false,
id: 'dashboard', id: 'dashboard',
path: 'dashboard',
}, },
} }
@ -41,6 +35,7 @@ export const DotOn: Story = {
isSelected: false, isSelected: false,
isDisabled: false, isDisabled: false,
id: 'dashboard', id: 'dashboard',
path: 'dashboard',
}, },
} }
@ -51,95 +46,6 @@ export const Selected: Story = {
isSelected: true, isSelected: true,
isDisabled: false, isDisabled: false,
id: 'dashboard', id: 'dashboard',
}, path: 'dashboard',
}
export const Disabled: Story = {
args: {
iconEl: <DashboardIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: true,
id: 'dashboard',
},
}
export const Dashboard: Story = {
args: {
iconEl: <DashboardIcon size={20} />,
isDotOn: false,
isSelected: true,
isDisabled: false,
id: 'dashboard',
},
}
export const Speed: Story = {
args: {
iconEl: <SpeedIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: false,
id: 'speed',
},
}
export const Chart: Story = {
args: {
iconEl: <ChartIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: true,
id: 'chart',
},
}
export const Heart: Story = {
args: {
iconEl: <HeartIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: false,
id: 'heart',
},
}
export const CodeBlock: Story = {
args: {
iconEl: <CodeBlockIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: false,
id: 'codeBlock',
},
}
export const Communities: Story = {
args: {
iconEl: <CommunitiesIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: false,
id: 'communities',
},
}
export const ActivityCenter: Story = {
args: {
iconEl: <ActivityCenterIcon size={20} />,
isDotOn: true,
isSelected: false,
isDisabled: false,
id: 'activityCenter',
},
}
export const Settings: Story = {
args: {
iconEl: <SettingsIcon size={20} />,
isDotOn: false,
isSelected: false,
isDisabled: false,
id: 'settings',
}, },
} }

View File

@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react' import type { Meta, StoryObj } from '@storybook/react'
import Dashboard from './Dashboard' import Dashboard from './Dashboard'
import { withRouter } from 'storybook-addon-react-router-v6'
const meta = { const meta = {
title: 'Pages/Dashboard', title: 'Pages/Dashboard',
@ -9,6 +10,7 @@ const meta = {
layout: 'centered', layout: 'centered',
}, },
tags: ['autodocs'], tags: ['autodocs'],
decorators: [withRouter],
} satisfies Meta<typeof Dashboard> } satisfies Meta<typeof Dashboard>
export default meta export default meta

View File

@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react' import type { Meta, StoryObj } from '@storybook/react'
import LogsPage from './LogsPage' import LogsPage from './LogsPage'
import { withRouter } from 'storybook-addon-react-router-v6'
const meta = { const meta = {
title: 'LogsPage/LogsPage', title: 'LogsPage/LogsPage',
@ -9,6 +10,7 @@ const meta = {
layout: 'centered', layout: 'centered',
}, },
tags: ['autodocs'], tags: ['autodocs'],
decorators: [withRouter],
} satisfies Meta<typeof LogsPage> } satisfies Meta<typeof LogsPage>
export default meta export default meta