2016-08-18 11:41:13 +02:00
|
|
|
/**
|
|
|
|
*
|
2017-08-21 15:12:53 +02:00
|
|
|
* App.js
|
2016-08-18 11:41:13 +02: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)
|
2016-08-18 11:47:26 +02:00
|
|
|
*
|
|
|
|
* NOTE: while this component should technically be a stateless functional
|
|
|
|
* component (SFC), hot reloading does not currently support SFCs. If hot
|
|
|
|
* reloading is not a neccessity for you then you can refactor it and remove
|
|
|
|
* the linting exception.
|
2016-08-18 11:41:13 +02:00
|
|
|
*/
|
|
|
|
|
2017-09-26 16:36:28 +02:00
|
|
|
import React from 'react';
|
2017-08-21 15:12:53 +02:00
|
|
|
import { Switch, Route } from 'react-router-dom';
|
2019-04-16 11:53:29 +02:00
|
|
|
import { LoadingIndicatorPage } from 'strapi-helper-plugin';
|
2019-02-22 10:05:07 +01:00
|
|
|
|
2019-04-03 13:05:18 +02:00
|
|
|
import Admin from '../Admin';
|
2019-02-22 10:05:07 +01:00
|
|
|
import NotFoundPage from '../NotFoundPage';
|
|
|
|
import NotificationProvider from '../NotificationProvider';
|
|
|
|
import AppLoader from '../AppLoader';
|
2016-08-24 15:09:42 +02:00
|
|
|
import styles from './styles.scss';
|
2016-08-18 11:41:13 +02:00
|
|
|
|
2019-04-03 13:05:18 +02:00
|
|
|
function App(props) {
|
2019-04-02 21:23:42 +02:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<NotificationProvider />
|
|
|
|
<AppLoader>
|
|
|
|
{({ shouldLoad }) => {
|
|
|
|
if (shouldLoad) {
|
|
|
|
return <LoadingIndicatorPage />;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={styles.container}>
|
|
|
|
<Switch>
|
2019-04-03 13:05:18 +02:00
|
|
|
<Route
|
2019-04-08 19:54:30 +02:00
|
|
|
path="/"
|
2019-04-03 13:05:18 +02:00
|
|
|
render={router => <Admin {...props} {...router} />}
|
|
|
|
/>
|
2019-04-08 19:54:30 +02:00
|
|
|
<Route path="" component={NotFoundPage} />
|
2019-04-02 21:23:42 +02:00
|
|
|
</Switch>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
</AppLoader>
|
|
|
|
</div>
|
|
|
|
);
|
2016-08-18 11:47:26 +02:00
|
|
|
}
|
2016-08-18 14:22:12 +02:00
|
|
|
|
2017-08-21 15:12:53 +02:00
|
|
|
App.propTypes = {};
|
2016-08-18 14:22:12 +02:00
|
|
|
|
2017-08-21 15:12:53 +02:00
|
|
|
export default App;
|