This repository was archived by the owner on Jan 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +2451
-72
lines changed Expand file tree Collapse file tree 5 files changed +2451
-72
lines changed Original file line number Diff line number Diff line change 1+ import '@storybook/addon-actions/register' ;
2+ import '@storybook/addon-links/register' ;
Original file line number Diff line number Diff line change 1+ import { configure } from '@storybook/react' ;
2+
3+ function loadStories ( ) {
4+ require ( '../src/stories' ) ;
5+ }
6+
7+ configure ( loadStories , module ) ;
Original file line number Diff line number Diff line change 5656 "test" : " react-app-rewired test" ,
5757 "jest" : " CI=true react-app-rewired test" ,
5858 "tslint" : " tslint --fix 'src/**/*.ts*'" ,
59- "mock" : " json-server mock/db.js"
59+ "mock" : " json-server mock/db.js" ,
60+ "storybook" : " start-storybook -p 9009 -s public" ,
61+ "build-storybook" : " build-storybook -s public"
6062 },
6163 "husky" : {
6264 "hooks" : {
7880 " not op_mini all"
7981 ],
8082 "devDependencies" : {
83+ "@storybook/addon-actions" : " ^5.1.9" ,
84+ "@storybook/addon-links" : " ^5.1.9" ,
85+ "@storybook/addons" : " ^5.1.9" ,
86+ "@storybook/react" : " ^5.1.9" ,
8187 "babel-plugin-import" : " ^1.12.0" ,
8288 "cross-env" : " ^5.2.0" ,
8389 "customize-cra" : " ^0.2.14" ,
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+
3+ import { storiesOf } from '@storybook/react' ;
4+ import { action } from '@storybook/addon-actions' ;
5+ import { linkTo } from '@storybook/addon-links' ;
6+
7+ import { Button , Welcome } from '@storybook/react/demo' ;
8+
9+ storiesOf ( 'Welcome' , module ) . add ( 'to Storybook' , ( ) => < Welcome showApp = { linkTo ( 'Button' ) } /> ) ;
10+
11+ storiesOf ( 'Button' , module )
12+ . add ( 'with text' , ( ) => < Button onClick = { action ( 'clicked' ) } > Hello Button</ Button > )
13+ . add ( 'with some emoji' , ( ) => (
14+ < Button onClick = { action ( 'clicked' ) } >
15+ < span role = "img" aria-label = "so cool" >
16+ 😀 😎 👍 💯
17+ </ span >
18+ </ Button >
19+ ) ) ;
You can’t perform that action at this time.
0 commit comments