-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
70 lines (66 loc) · 1.71 KB
/
App.tsx
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import CssBaseline from "@material-ui/core/CssBaseline";
import { createMuiTheme, Theme, withStyles } from "@material-ui/core/styles";
import { ThemeProvider } from "@material-ui/styles";
import React, { ReactElement } from "react";
import {
BrowserRouter as Router,
Redirect,
Route,
Switch,
} from "react-router-dom";
import ConnectionFailed from "./common/ConnectionFailed";
import NotFound from "./common/NotFound";
import Dashboard from "./dashboard/Dashboard";
import { Path } from "./router/Path";
const darkTheme = createMuiTheme({
palette: {
type: "dark",
},
});
const GlobalCss = withStyles((theme: Theme) => {
return {
"@global": {
"::-webkit-scrollbar": {
width: 8,
},
"::-webkit-scrollbar-track": {
background: theme.palette.background.default,
},
"::-webkit-scrollbar-thumb": {
borderRadius: "4px",
background: theme.palette.background.paper,
},
"::-webkit-scrollbar-thumb:hover": {
background: theme.palette.grey[700],
},
"::-webkit-scrollbar-corner": {
backgroundColor: "transparent",
},
},
};
})(() => null);
function App(): ReactElement {
return (
<ThemeProvider theme={darkTheme}>
<CssBaseline />
<GlobalCss />
<Router>
<Switch>
<Route path={Path.CONNECTION_FAILED}>
<ConnectionFailed />
</Route>
<Route path={Path.DASHBOARD}>
<Dashboard />
</Route>
<Route exact path={Path.HOME}>
<Redirect to={Path.DASHBOARD} />
</Route>
<Route>
<NotFound />
</Route>
</Switch>
</Router>
</ThemeProvider>
);
}
export default App;