2018-01-29 20:47:12 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Provider } from 'react-redux';
|
2018-01-29 21:27:22 +01:00
|
|
|
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
2018-02-16 00:55:24 +01:00
|
|
|
import withAnalytics from 'utils/googleAnalytics';
|
2018-01-29 20:47:12 +01:00
|
|
|
|
|
|
|
import PublishPage from 'components/PublishPage';
|
|
|
|
import AboutPage from 'components/AboutPage';
|
2018-02-02 23:24:46 +01:00
|
|
|
import LoginPage from 'containers/LoginPage';
|
2018-02-01 23:29:33 +01:00
|
|
|
import ShowPage from 'containers/ShowPage';
|
2018-02-09 19:53:59 +01:00
|
|
|
import FourOhFourPage from 'components/FourOhFourPage';
|
2018-01-29 20:47:12 +01:00
|
|
|
|
|
|
|
const Root = ({ store }) => (
|
|
|
|
<Provider store={store}>
|
2018-01-29 21:27:22 +01:00
|
|
|
<BrowserRouter>
|
|
|
|
<Switch>
|
2018-02-16 00:55:24 +01:00
|
|
|
<Route exact path="/" component={withAnalytics(PublishPage)} />
|
|
|
|
<Route exact path="/about" component={withAnalytics(AboutPage)} />
|
|
|
|
<Route exact path="/login" component={withAnalytics(LoginPage)} />
|
|
|
|
<Route exact path="/:identifier/:claim" component={withAnalytics(ShowPage)} />
|
|
|
|
<Route exact path="/:claim" component={withAnalytics(ShowPage)} />
|
|
|
|
<Route component={withAnalytics(FourOhFourPage)} />
|
2018-01-29 21:27:22 +01:00
|
|
|
</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;
|