Skip to content

Commit 5cd37c2

Browse files
committed
Fix storybooks
1 parent 8aa2914 commit 5cd37c2

File tree

10 files changed

+1233
-507
lines changed

10 files changed

+1233
-507
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ updates:
33
- package-ecosystem: "npm"
44
directory: "/"
55
schedule:
6-
interval: "daily"
6+
interval: "weekly"
7+
day: "thursday"
8+
ignore:
9+
- dependency-name: "@storybook*"

.github/workflows/ci.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@ jobs:
1414
- uses: actions/setup-node@v2
1515
with:
1616
node-version: "14"
17-
- run: npm install
17+
- run: npm ci
1818
- run: npm run prettier-ci
1919

20+
storybook:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v2
25+
with:
26+
node-version: "14"
27+
- run: npm ci
28+
- run: npm run storybook-ci
29+
2030
build:
2131
runs-on: ubuntu-latest
2232
steps:
2333
- uses: actions/checkout@v2
2434
- uses: actions/setup-node@v2
2535
with:
2636
node-version: "14"
27-
- run: npm install
37+
- run: npm ci
2838
- run: npm run build --if-present

.storybook/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module.exports = {
2-
stories: ["../src/**/*.stories.js"],
2+
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
33
addons: [
44
"@storybook/preset-create-react-app",
55
"@storybook/addon-actions",
6+
"@storybook/addon-links",
67
"@storybook/addon-storysource",
8+
"@storybook/addon-essentials",
79
"@storybook/addon-knobs/register",
8-
"@storybook/addon-viewport/register",
910
],
1011
};

.storybook/preview.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Suspense } from "react";
22
import { addParameters, addDecorator } from "@storybook/react";
3+
import { QueryClient, QueryClientProvider } from "react-query";
34
import { MINIMAL_VIEWPORTS } from "@storybook/addon-viewport";
45
import { withKnobs } from "@storybook/addon-knobs";
56
import StoryRouter from "storybook-react-router";
@@ -11,12 +12,17 @@ import "../src/i18n";
1112
import "semantic-ui-css/semantic.min.css";
1213
import "../src/index.css";
1314

15+
const queryClient = new QueryClient();
16+
1417
addDecorator(withKnobs);
1518
addDecorator(StoryRouter());
1619
addDecorator((storyFn) => <Suspense fallback="Loading...">{storyFn()}</Suspense>);
1720
addDecorator((storyFn) => <MediaContextProvider>{storyFn()}</MediaContextProvider>);
1821
addDecorator((storyFn) => <HelmetProvider>{storyFn()}</HelmetProvider>);
1922
addDecorator((storyFn) => <UserContextMock>{storyFn()}</UserContextMock>);
23+
addDecorator((storyFn) => (
24+
<QueryClientProvider client={queryClient}>{storyFn()}</QueryClientProvider>
25+
));
2026
addDecorator((storyFn) => <Suspense fallback="Loading">{storyFn()}</Suspense>);
2127

2228
const customViewports = {
@@ -46,3 +52,7 @@ addParameters({
4652
},
4753
},
4854
});
55+
56+
export const parameters = {
57+
actions: { argTypesRegex: "^on[A-Z].*" },
58+
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Sometimes you may want to run parts of application on their own. You can do this
2121
- Run firebase emulators with `npx firebase emulators:start`.
2222
- Run react dev server with `npm run start:client`.
2323
- Run game server with: `node -r esm src/server.js`.
24-
- Run storybook wiht: `npm run storybook`.
24+
- Run storybook wiht: `npm run start:storybook`.
2525

2626
## Note
2727

0 commit comments

Comments
 (0)