2019-06-10 00:29:10 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
import { hot } from 'react-hot-loader/root';
|
2019-06-10 02:26:20 +00:00
|
|
|
import { BrowserRouter as Router, Route } from 'react-router-dom';
|
|
|
|
import AuthenticationRouter from '@/routers/AuthenticationRouter';
|
2019-06-12 06:12:03 +00:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { persistor, store } from '@/redux/configure';
|
|
|
|
import { PersistGate } from 'redux-persist/integration/react';
|
2019-06-10 00:29:10 +00:00
|
|
|
|
|
|
|
class App extends React.PureComponent {
|
|
|
|
render () {
|
|
|
|
return (
|
2019-06-12 06:12:03 +00:00
|
|
|
<Provider store={store}>
|
|
|
|
<PersistGate persistor={persistor} loading={this.renderLoading()}>
|
|
|
|
<Router>
|
|
|
|
<div>
|
|
|
|
<Route exact path="/"/>
|
|
|
|
<Route path="/auth" component={AuthenticationRouter}/>
|
|
|
|
</div>
|
|
|
|
</Router>
|
|
|
|
</PersistGate>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
renderLoading () {
|
|
|
|
return (
|
|
|
|
<div className={'spinner spinner-lg'}></div>
|
2019-06-10 00:29:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default hot(App);
|