From 22a26f9a5c6c95abdba558e280a413e87b192b1d Mon Sep 17 00:00:00 2001 From: Vadim Dalecky Date: Fri, 11 May 2018 20:37:16 +0100 Subject: [PATCH] feat: add stories --- src/WindowWidthSensor/__story__/story.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/WindowWidthSensor/__story__/story.js diff --git a/src/WindowWidthSensor/__story__/story.js b/src/WindowWidthSensor/__story__/story.js new file mode 100644 index 00000000..b5f8dd54 --- /dev/null +++ b/src/WindowWidthSensor/__story__/story.js @@ -0,0 +1,18 @@ +import {createElement as h} from 'react'; +import {storiesOf} from '@storybook/react'; +import {action} from '@storybook/addon-actions'; +import {WindowWidthSensor} from '..'; +import ShowDocs from '../../../.storybook/ShowDocs' + +storiesOf('Sensors/WindowWidthSensor', module) + // .add('Documentation', () => h(ShowDocs, {md: require('../../../docs/en/WindowWidthSensor.md')})) + .add('Example', () => + h(WindowWidthSensor, {onChange: action('onChange')}, ({width, height}) => + h('div', {}, + `WIDTH: ${width}, HEIGHT: ${height}` + ) + ) + ) + .add('No children', () => + h(WindowWidthSensor, {onChange: action('onChange')}) + )