2018-12-06 18:03:56 +01:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* This component is the skeleton around the actual pages, and should only
|
|
|
|
|
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import { createStructuredSelector } from 'reselect';
|
|
|
|
|
import { Switch, Route } from 'react-router-dom';
|
|
|
|
|
import { bindActionCreators, compose } from 'redux';
|
|
|
|
|
// Utils
|
|
|
|
|
import { pluginId } from 'app';
|
|
|
|
|
// Containers
|
|
|
|
|
import HomePage from 'containers/HomePage';
|
|
|
|
|
import NotFoundPage from 'containers/NotFoundPage';
|
|
|
|
|
|
|
|
|
|
class App extends React.Component {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div className={pluginId}>
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route path={`/plugins/${pluginId}`} component={HomePage} exact />
|
|
|
|
|
<Route component={NotFoundPage} />
|
|
|
|
|
</Switch>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
App.propTypes = {};
|
|
|
|
|
|
|
|
|
|
export function mapDispatchToProps(dispatch) {
|
2018-12-06 23:20:18 +01:00
|
|
|
return bindActionCreators({}, dispatch);
|
2018-12-06 18:03:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = createStructuredSelector({});
|
|
|
|
|
|
|
|
|
|
// Wrap the component to inject dispatch and state into it
|
2018-12-06 23:20:18 +01:00
|
|
|
const withConnect = connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps,
|
|
|
|
|
);
|
2018-12-06 18:03:56 +01:00
|
|
|
|
2018-12-06 23:20:18 +01:00
|
|
|
export default compose(withConnect)(App);
|