Skip to content

Commit 15a6933

Browse files
committed
add router support for storybook
1 parent 7a79039 commit 15a6933

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"eslint-plugin-react": "^7.7.0",
4747
"husky": "^0.14.3",
4848
"lint-staged": "^7.0.4",
49-
"prettier": "^1.12.1"
49+
"prettier": "^1.12.1",
50+
"storybook-react-router": "1.0.1"
5051
}
5152
}

src/app/components/AppBar/AppBar.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import React from 'react';
33
import { storiesOf } from '@storybook/react';
44
import { action } from '@storybook/addon-actions';
55
import { linkTo } from '@storybook/addon-links';
6+
import StoryRouter from 'storybook-react-router';
67

7-
import { AppBar } from './AppBar';
8+
import AppBar from './AppBar';
89

910
storiesOf('AppBar', module)
11+
.addDecorator(StoryRouter())
1012
.add('non authenthicated', () => <AppBar />)
1113
.add('authenthicated', () => (
1214
<AppBar auth={{ user: { name: 'Alejandro' } }} />

yarn.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8572,6 +8572,12 @@ stifle@^1.0.2:
85728572
version "1.0.4"
85738573
resolved "https://registry.yarnpkg.com/stifle/-/stifle-1.0.4.tgz#8b3bcdf52419b0a9c79e35adadce50123c1d8e99"
85748574

8575+
storybook-react-router@1.0.1:
8576+
version "1.0.1"
8577+
resolved "https://registry.yarnpkg.com/storybook-react-router/-/storybook-react-router-1.0.1.tgz#a33af1cb0c16f0e755f420296352c8f8709cb674"
8578+
dependencies:
8579+
prop-types "^15.6.1"
8580+
85758581
stream-browserify@^2.0.1:
85768582
version "2.0.1"
85778583
resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db"

0 commit comments

Comments
 (0)