27 lines
542 B
JavaScript
27 lines
542 B
JavaScript
import {Component} from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import getMuiTheme from './getMuiTheme';
|
|
|
|
class MuiThemeProvider extends Component {
|
|
|
|
static propTypes = {
|
|
children: PropTypes.element,
|
|
muiTheme: PropTypes.object,
|
|
};
|
|
|
|
static childContextTypes = {
|
|
muiTheme: PropTypes.object.isRequired,
|
|
};
|
|
|
|
getChildContext() {
|
|
return {
|
|
muiTheme: this.props.muiTheme || getMuiTheme(),
|
|
};
|
|
}
|
|
|
|
render() {
|
|
return this.props.children;
|
|
}
|
|
}
|
|
|
|
export default MuiThemeProvider;
|