blob: dc96e22d103683193a0b33d25a54656b314a1ae5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
import React from 'react';
import { Provider } from 'm/store';
import { HashRouter as Router, Route } from 'react-router-dom';
// import { hot } from 'react-hot-loader';
// import createHistory from 'history/createHashHistory';
// import createHistory from 'history/createBrowserHistory';
import ErrorBoundary from 'c/ErrorBoundary';
import SideBar from 'c/SideBar';
import Home from 'c/Home';
import Logs from 'c/Logs';
import Proxies from 'c/Proxies';
import Config from 'c/Config';
import APIDiscovery from 'c/APIDiscovery';
import { store } from '../store/configureStore';
// testing...
// import StyleGuide from 'c/StyleGuide';
import './Root.scss';
import s0 from './Root.module.scss';
window.store = store;
const Root = () => (
<ErrorBoundary>
<Provider store={store}>
<Router>
<div className={s0.app}>
<APIDiscovery />
<Route path="/" render={() => <SideBar />} />
<div className={s0.content}>
<Route exact path="/" render={() => <Home />} />
<Route exact path="/overview" render={() => <Home />} />
<Route exact path="/configs" render={() => <Config />} />
<Route exact path="/logs" render={() => <Logs />} />
<Route exact path="/proxies" render={() => <Proxies />} />
</div>
</div>
</Router>
</Provider>
</ErrorBoundary>
);
// <Route exact path="/__0" component={StyleGuide} />
// <Route exact path="/__1" component={Loading} />
// hot export Root
// https://github.com/gaearon/react-hot-loader/tree/v4.0.1#getting-started
// RHL doesn't compatible with React Hook yet, see:
// https://github.com/gaearon/react-hot-loader/issues/1088
// after it's working, uncommment below line and remove "//" in the babelrc
// export default hot(module)(Root);
export default Root;
|