Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdfc353b

Browse files
authored
fix: Fix storybook blockers (#443)
I was just testing `storybook` out on `main`, and saw some of the components had errors:<img width="1564" alt="image" src="https://user-images.githubusercontent.com/88213859/158444846-773420f5-261a-4853-abe1-66521ed19901.png">There were two problems:- The `<Workspace />` component had new arguments, that don't seem to be validated by `yarn storybook:build`- The top-level `react-router-dom` is not available in storybook. After fixing these, all the storybook components work:<img width="1304" alt="image" src="https://user-images.githubusercontent.com/88213859/158445124-eec51500-967d-4e24-823f-c21f6ea63ba1.png">
1 parent97399f8 commitdfc353b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎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_HistoryRouterasHistoryRouter}from"react-router-dom"
57

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

10+
consthistory=createMemoryHistory()
11+
12+
constrouterDecorator=(Story)=>{
13+
return(
14+
<HistoryRouterhistory={history}>
15+
<Story/>
16+
</HistoryRouter>
17+
)
18+
}
19+
20+
addDecorator(routerDecorator)
21+
822
exportconstparameters={
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
importReactfrom"react"
33
import{Workspace,WorkspaceProps}from"./Workspace"
4-
import{MockWorkspace}from"../../test_helpers"
4+
import{MockOrganization,MockProject,MockWorkspace}from"../../test_helpers"
55

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp