forked from Kopano-dev/kpop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.wrapper.js
38 lines (30 loc) · 949 Bytes
/
styleguide.wrapper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { MuiThemeProvider } from '@material-ui/core/styles';
import { defaultTheme as theme } from './src/theme';
import { locales } from './i18n/locales';
import IntlContainer from './src/IntlContainer';
// Generate empty translations for syleguide app. This enables all translations
// defined in kpop.
const translations = (() => {
return Object.keys(locales).reduce(function(result, item) {
result[item] = {};
return result;
}, {});
})();
class Wrapper extends Component {
onLocaleChanged = () => {
}
render() {
const { children } = this.props;
return (
<MuiThemeProvider theme={theme}>
<IntlContainer messages={translations} onLocaleChanged={this.onLocaleChanged}>{children}</IntlContainer>
</MuiThemeProvider>
);
}
}
Wrapper.propTypes = {
children: PropTypes.node.isRequired,
};
export default Wrapper;