mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 10:30:04 +01:00
b6487f08b7
The `@storybook/addon-backgrounds' addon has been added, which allows changing the component preview background. By default no background colors are defined, though there is a helpful grid button. A "light" and "dark" background option has been added globally. Additional story-specific backgrounds or global backgrounds can be added later if necessary.
27 lines
519 B
JavaScript
27 lines
519 B
JavaScript
import React from 'react'
|
|
import { addDecorator, addParameters } from '@storybook/react'
|
|
import { withKnobs } from '@storybook/addon-knobs/react'
|
|
|
|
addParameters({
|
|
backgrounds: [
|
|
{ name: 'light', value: '#FFFFFF'},
|
|
{ name: 'dark', value: '#333333' },
|
|
],
|
|
})
|
|
|
|
const styles = {
|
|
height: '100vh',
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
}
|
|
|
|
const CenterDecorator = story => (
|
|
<div style={styles}>
|
|
{ story() }
|
|
</div>
|
|
)
|
|
|
|
addDecorator(withKnobs)
|
|
addDecorator(CenterDecorator)
|