aboutsummaryrefslogtreecommitdiffstats
path: root/.storybook/decorators.js
blob: 7b0745ac4902608caa2522274d01f11ce3a501e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)