Sha256: c44fbf28e038b1746a88071ef42b0d79d820885de1d12a0c0e8b8e1d9405a30e
Contents?: true
Size: 1.5 KB
Versions: 17
Compression:
Stored size: 1.5 KB
Contents
import React from 'react'; import { storiesOf } from '@storybook/react'; import { withKnobs, object, select } from '@storybook/addon-knobs'; import { action } from '@storybook/addon-actions'; import { TASKS_DASHBOARD_AVAILABLE_TIMES, TASKS_DASHBOARD_AVAILABLE_QUERY_STATES, TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS, TASKS_DASHBOARD_AVAILABLE_QUERY_MODES, } from '../../TasksDashboardConstants'; import { MOCKED_DATA } from './TasksCardsGrid.fixtures'; import TasksCardsGrid from './TasksCardsGrid'; const createSelect = (name, options) => select(name, { ...options, NONE: 'none' }, 'none'); storiesOf('TasksDashboard/TasksCardsGrid', module) .addDecorator(withKnobs) .add('TasksCardsGrid', () => { const selectTime = select( 'time', TASKS_DASHBOARD_AVAILABLE_TIMES, TasksCardsGrid.defaultProps.time ); const selectState = createSelect( 'query.state', TASKS_DASHBOARD_AVAILABLE_QUERY_STATES ); const selectResult = createSelect( 'query.result', TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS ); const selectMode = createSelect( 'query.mode', TASKS_DASHBOARD_AVAILABLE_QUERY_MODES ); return ( <div> <TasksCardsGrid time={selectTime} query={{ state: selectState, result: selectResult, mode: selectMode, time: selectTime, }} data={object('data', MOCKED_DATA)} updateQuery={action('updateQuery')} /> </div> ); });
Version data entries
17 entries across 17 versions & 1 rubygems