@@ -2,6 +2,7 @@ import React from 'react'
22import { Route , RouteComponentProps } from 'react-router-dom'
33import StoryRouter from 'storybook-react-router'
44import { storiesOf } from '@storybook/react'
5+ import { withKnobs , text , number } from '@storybook/addon-knobs'
56import Addresses from 'components/Addresses'
67import initStates from 'states/initStates'
78import addressesStates from './data/addresses'
@@ -20,3 +21,15 @@ const stories = storiesOf('Addresses', module).addDecorator(StoryRouter())
2021Object . entries ( addressesStates ) . forEach ( ( [ title , list ] ) => {
2122 stories . add ( title , ( ) => < AddressWithRouteProps addresses = { list } /> )
2223} )
24+
25+ stories . addDecorator ( withKnobs ) . add ( 'With knobs' , ( ) => {
26+ const addrs = addressesStates [ 'Content List' ] . map ( ( addr , idx ) => ( {
27+ address : text ( `${ idx } -Address` , addr . address ) ,
28+ identifier : text ( `${ idx } -Identifier` , addr . identifier ) ,
29+ description : text ( `${ idx } -Description` , addr . description ) ,
30+ type : number ( `${ idx } -Type` , addr . type ) as 0 | 1 ,
31+ txCount : number ( `${ idx } -Tx count` , addr . txCount ) ,
32+ balance : text ( `${ idx } -Balance` , addr . balance ) ,
33+ } ) )
34+ return < AddressWithRouteProps addresses = { addrs } />
35+ } )
0 commit comments