2018-05-03 19:51:15 +02:00
|
|
|
import React from 'react'
|
2020-02-26 18:40:53 +01:00
|
|
|
import { addDecorator, addParameters } from '@storybook/react'
|
2018-05-03 19:51:15 +02:00
|
|
|
import { withKnobs } from '@storybook/addon-knobs/react'
|
2020-03-25 00:31:47 +01:00
|
|
|
import { I18nProvider, LegacyI18nProvider } from '../ui/app/contexts/i18n'
|
2020-03-17 20:15:53 +01:00
|
|
|
import { Provider } from 'react-redux'
|
|
|
|
import configureStore from '../ui/app/store/store'
|
2020-02-28 00:17:27 +01:00
|
|
|
import '../ui/app/css/index.scss'
|
2020-03-17 20:15:53 +01:00
|
|
|
import en from '../app/_locales/en/messages'
|
2018-05-03 19:51:15 +02:00
|
|
|
|
2020-02-26 18:40:53 +01:00
|
|
|
addParameters({
|
|
|
|
backgrounds: [
|
|
|
|
{ name: 'light', value: '#FFFFFF'},
|
|
|
|
{ name: 'dark', value: '#333333' },
|
|
|
|
],
|
|
|
|
})
|
|
|
|
|
2018-05-03 19:51:15 +02:00
|
|
|
const styles = {
|
|
|
|
height: '100vh',
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
}
|
|
|
|
|
2020-03-17 20:15:53 +01:00
|
|
|
const store = configureStore({
|
|
|
|
metamask: { metamask: { currentLocale: 'en' } },
|
|
|
|
|
|
|
|
localeMessages: {
|
|
|
|
current: en,
|
|
|
|
en: en,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
const metamaskDecorator = story => (
|
|
|
|
<Provider store={store}>
|
|
|
|
<I18nProvider>
|
2020-03-25 00:31:47 +01:00
|
|
|
<LegacyI18nProvider>
|
|
|
|
<div style={styles}>
|
|
|
|
{ story() }
|
|
|
|
</div>
|
|
|
|
</LegacyI18nProvider>
|
2020-03-17 20:15:53 +01:00
|
|
|
</I18nProvider>
|
|
|
|
</Provider>
|
2018-05-03 19:51:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
addDecorator(withKnobs)
|
2020-03-17 20:15:53 +01:00
|
|
|
addDecorator(metamaskDecorator)
|