Skip to content
Snippets Groups Projects
Commit 4247ac2e authored by Alexandros Georgantas's avatar Alexandros Georgantas
Browse files

Initial commit for modal functionality

parent 83b12bd9
No related branches found
No related tags found
No related merge requests found
Pipeline #3412 failed with stage
in 1 minute and 35 seconds
......@@ -3,14 +3,30 @@ import { ConnectedRouter } from 'react-router-redux'
import { Provider } from 'react-redux'
import PropTypes from 'prop-types'
import { ThemeProvider } from 'react-css-themr'
import ModalContainer from 'pubsweet-component-universal-modal/ModalContainer'
import config from 'config'
const Root = ({ store, history, routes, theme }) => (
<Provider store={store}>
<ConnectedRouter history={history}>
<ThemeProvider theme={theme}>{routes}</ThemeProvider>
</ConnectedRouter>
</Provider>
)
const Root = ({ store, history, routes, theme }) => {
const { withModal } = config['pubsweet-client']
let app
if (withModal) {
app = (
<div>
{routes}
<ModalContainer />
</div>
)
} else {
app = { routes }
}
return (
<Provider store={store}>
<ConnectedRouter history={history}>
<ThemeProvider theme={theme}>{app}</ThemeProvider>
</ConnectedRouter>
</Provider>
)
}
Root.propTypes = {
routes: PropTypes.node.isRequired,
......
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