spee.ch/react/root.js

30 lines
895 B
JavaScript
Raw Normal View History

2018-01-29 20:47:12 +01:00
import React from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
2018-01-29 20:47:12 +01:00
import PublishPage from 'components/PublishPage';
import AboutPage from 'components/AboutPage';
import LoginPage from 'containers/LoginPage';
import ShowPage from 'containers/ShowPage';
2018-01-29 20:47:12 +01:00
const Root = ({ store }) => (
<Provider store={store}>
<BrowserRouter>
<Switch>
<Route exact path="/" component={PublishPage} />
<Route exact path="/about" component={AboutPage} />
<Route exact path="/login" component={LoginPage} />
<Route exact path="/:identifier/:claim" component={ShowPage} />
<Route exact path="/:claim/" component={ShowPage} />
</Switch>
</BrowserRouter>
2018-01-29 20:47:12 +01:00
</Provider>
2018-01-29 21:49:01 +01:00
);
2018-01-29 20:47:12 +01:00
Root.propTypes = {
store: PropTypes.object.isRequired,
2018-01-29 21:49:01 +01:00
};
2018-01-29 20:47:12 +01:00
export default Root;