aboutsummaryrefslogtreecommitdiffstats
path: root/.storybook/decorators.js
diff options
context:
space:
mode:
Diffstat (limited to '.storybook/decorators.js')
-rw-r--r--.storybook/decorators.js21
1 files changed, 21 insertions, 0 deletions
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 => (
+ <div style={styles}>
+ { story() }
+ </div>
+)
+
+addDecorator((story, context) => withInfo()(story)(context))
+addDecorator(withKnobs)
+addDecorator(CenterDecorator)