From d5759cf4a8041d1a7cfd55a7d55d8b7ecb29caca Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Thu, 3 May 2018 10:51:15 -0700 Subject: Add storybook integration --- .storybook/decorators.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .storybook/decorators.js (limited to '.storybook/decorators.js') diff --git a/.storybook/decorators.js b/.storybook/decorators.js new file mode 100644 index 000000000..7b0745ac4 --- /dev/null +++ b/.storybook/decorators.js @@ -0,0 +1,21 @@ +import React from 'react' +import { addDecorator } from '@storybook/react' +import { withInfo } from '@storybook/addon-info' +import { withKnobs } from '@storybook/addon-knobs/react' + +const styles = { + height: '100vh', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', +} + +const CenterDecorator = story => ( +
+ { story() } +
+) + +addDecorator((story, context) => withInfo()(story)(context)) +addDecorator(withKnobs) +addDecorator(CenterDecorator) -- cgit v1.2.3