Commit cf2f3a25 authored by Alf Eaton's avatar Alf Eaton

Add ThemeProvider to Root

fixes #53

This imports `ThemeProvider` from `react-css-themr` and adds it to the client app, using a `theme` parameter that will contain the theme object.
parent e26f8b32
Pipeline #2870 passed with stage
in 1 minute and 46 seconds
......@@ -2,22 +2,21 @@ import React from 'react'
import { ConnectedRouter } from 'react-router-redux'
import { Provider } from 'react-redux'
import PropTypes from 'prop-types'
import { ThemeProvider } from 'react-css-themr'
export default class Root extends React.Component {
render() {
const { store, history, routes } = this.props
return (
<Provider store={store}>
<div>
<ConnectedRouter history={history}>{routes}</ConnectedRouter>
</div>
</Provider>
)
}
}
const Root = ({ store, history, routes, theme }) => (
<Provider store={store}>
<ConnectedRouter history={history}>
<ThemeProvider theme={theme}>{routes}</ThemeProvider>
</ConnectedRouter>
</Provider>
)
Root.propTypes = {
routes: PropTypes.node.isRequired,
history: PropTypes.object.isRequired,
store: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired,
}
export default Root
......@@ -2100,6 +2100,10 @@ hoek@4.x.x:
version "4.2.0"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d"
hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
hoist-non-react-statics@^2.2.1, hoist-non-react-statics@^2.3.0, hoist-non-react-statics@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0"
......@@ -3614,6 +3618,13 @@ react-bootstrap@^0.31.3:
uncontrollable "^4.1.0"
warning "^3.0.0"
react-css-themr@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/react-css-themr/-/react-css-themr-2.1.2.tgz#e017514e471c232f43a754a55b49d81faf5dafb8"
dependencies:
hoist-non-react-statics "^1.2.0"
invariant "^2.2.1"
react-dom@^15.6.1:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment