import React from 'react'; import centered from '@storybook/addon-centered/react'; import { storiesOf } from '@storybook/react'; import importAll from '../../src/utils/importAll'; import parsePathToName from '../../src/utils/parsePathToName'; import ColumnsLayout from '../../src/components/ColumnsLayout'; const iconStyle = { height: '50vh', maxWidth: '100%' }; const iconsList = require.context('../../src/assets/svg', false, /\.(png|jpe?g|svg)$/); const icons = importAll(iconsList); const stories = storiesOf('Assets|Icons', module); stories.addDecorator(centered); stories.addParameters({ backgrounds: [{ name: 'silver', value: '#cacaca', default: true }], }); stories.add('_all', () => { return ( {icons.map((icon, i) => { const Icon = icon.ReactComponent; return ( {parsePathToName(iconsList.keys()[i])} ); })} ); }); icons.forEach((icon, i) => { const Icon = icon.ReactComponent; stories.add(`${parsePathToName(iconsList.keys()[i])}`, () => ); });
{parsePathToName(iconsList.keys()[i])}