1 | import React from 'react'
|
2 |
|
3 | import { storiesOf } from '@storybook/react'
|
4 | import { action } from '@storybook/addon-actions'
|
5 | import { Provider } from 'react-redux'
|
6 | import { createStore } from 'redux'
|
7 |
|
8 | import FeatureDetail from '../src/components/FeatureDetail'
|
9 |
|
10 | const feature = require('./fixtures/feature.json')
|
11 | const fieldAnalysis = require('./fixtures/field_analysis')
|
12 |
|
13 | const media = [{
|
14 | 'fieldname': 'picture.url',
|
15 | 'value': 'https://s3.amazonaws.com/images.digital-democracy.org/mapfilter-sample/sample-14.jpg'
|
16 | }, {
|
17 | 'fieldname': 'picture2',
|
18 | 'value': 'https://s3.amazonaws.com/images.digital-democracy.org/mapfilter-sample/sample-14.jpg'
|
19 | }, {
|
20 | 'fieldname': 'picture3',
|
21 | 'value': 'https://s3.amazonaws.com/images.digital-democracy.org/mapfilter-sample/sample-14.jpg'
|
22 | }]
|
23 |
|
24 | const store = createStore(state => state, {})
|
25 |
|
26 | storiesOf('FeatureDetail', module)
|
27 | .add('Default', () => (
|
28 | <Provider store={store}>
|
29 | <div style={{maxWidth: 600, margin: 'auto'}}>
|
30 | <FeatureDetail
|
31 | onRequestClose={action('requestClose')}
|
32 | onDeleteFeature={action('deleteFeature')}
|
33 | onEditFeature={action('editFeature')}
|
34 | feature={feature}
|
35 | fieldAnalysis={fieldAnalysis}
|
36 | media={media}
|
37 | />
|
38 | </div>
|
39 | </Provider>
|
40 | ))
|