Skip to content

Commit 54e2cc8

Browse files
committed
fix: Fix storybook blockers
1 parent 97399f8 commit 54e2cc8

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎site/.storybook/preview.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@ import ThemeProvider from "@material-ui/styles/ThemeProvider"
22
import { withThemes } from "@react-theming/storybook-addon"
33
import { light, dark } from "../theme"
44
import { addDecorator } from "node_modules/@storybook/react"
5+
import { createMemoryHistory } from "history"
6+
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
57

68
addDecorator(withThemes(ThemeProvider, [light, dark]))
79

10+
const history = createMemoryHistory()
11+
12+
const routerDecorator = (Story) => {
13+
return (
14+
<HistoryRouter history={history}>
15+
<Story />
16+
</HistoryRouter>
17+
)
18+
}
19+
20+
addDecorator(routerDecorator)
21+
822
export const parameters = {
923
actions: {
1024
argTypesRegex: "^on[A-Z].*",

‎site/components/Workspace/Workspace.stories.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Story } from "@storybook/react"
22
import React from "react"
33
import { Workspace, WorkspaceProps } from "./Workspace"
4-
import { MockWorkspace } from "../../test_helpers"
4+
import { MockOrganization, MockProject, MockWorkspace } from "../../test_helpers"
55

66
export default {
77
title: "Workspace",
@@ -13,5 +13,7 @@ const Template: Story<WorkspaceProps> = (args) => <Workspace {...args} />
1313

1414
export const Example = Template.bind({})
1515
Example.args = {
16+
organization: MockOrganization,
17+
project: MockProject,
1618
workspace: MockWorkspace,
1719
}

0 commit comments

Comments
 (0)