@@ -3,39 +3,40 @@ import { storiesOf } from '@storybook/react'
33import { action } from '@storybook/addon-actions'
44
55import SideBarDecorator from './utils/SideBarDecorator'
6+ import NewPage from '../src/containers/New/NewPage'
67import TutorialList from '../src/containers/New/TutorialList'
78import TutorialItem from '../src/containers/New/TutorialList/TutorialItem'
89
10+ const tutorialList = [
11+ {
12+ id :'1' ,
13+ version :{
14+ summary :{
15+ title :'Tutorial 1' ,
16+ description :'The first one' ,
17+ } ,
18+ } ,
19+ } ,
20+ {
21+ id :'2' ,
22+ version :{
23+ summary :{
24+ title :'Tutorial 2' ,
25+ description :'The second one' ,
26+ } ,
27+ } ,
28+ } ,
29+ ]
30+
931storiesOf ( 'New' , module )
1032. addDecorator ( SideBarDecorator )
33+ . add ( 'New Page' , ( ) => {
34+ return < NewPage tutorialList = { tutorialList } />
35+ } )
1136. add ( 'Tutorial List' , ( ) => {
12- const tutorialList = [
13- {
14- id :'1' ,
15- version :{
16- summary :{
17- title :'Tutorial 1' ,
18- description :'The first one' ,
19- } ,
20- } ,
21- } ,
22- {
23- id :'2' ,
24- version :{
25- summary :{
26- title :'Tutorial 2' ,
27- description :'The second one' ,
28- } ,
29- } ,
30- } ,
31- ]
3237return < TutorialList tutorialList = { tutorialList } />
3338} )
3439. add ( 'Tutorial Item' , ( ) => {
35- const tutorial = {
36- id :'1' ,
37- title :'Tutorial 1' ,
38- description :'The first one' ,
39- }
40+ const tutorial = tutorialList [ 0 ]
4041return < TutorialItem onSelect = { action ( 'onSelect' ) } title = { tutorial . title } description = { tutorial . description } />
4142} )