-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
171 lines (167 loc) · 8.82 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import * as React from "react";
import { Router, Switch, Route } from "react-router-dom";
import Header from "./components/header/Header";
import Footer from "./components/footer/Footer";
import history from "./components/identity/History";
import ErrorGuard from "./components/errors/ErrorGuard";
import InfoProvider from "./components/info/InfoProvider";
import { CIDCThemeProvider, useRootStyles } from "./rootStyles";
import { QueryParamProvider } from "use-query-params";
import NotFoundRoute from "./components/generic/NotFoundRoute";
import IdentityProvider from "./components/identity/IdentityProvider";
import { AnalysesDocsPage } from "./components/upload-docs/UploadDocsPages";
import { SWRConfig } from "swr";
import { apiFetch } from "./api/api";
// Code-split across different routes on the site
const HomePage = React.lazy(() => import("./components/home/HomePage"));
const ManifestsPage = React.lazy(() =>
import("./components/manifests/ManifestsPage")
);
const PrivacyAndSecurityPage = React.lazy(() =>
import("./components/privacy-and-security/PrivacyAndSecurityPage")
);
const ProfilePage = React.lazy(() =>
import("./components/profile/ProfilePage")
);
const Register = React.lazy(() => import("./components/identity/Register"));
const SchemaPage = React.lazy(() => import("./components/schema/SchemaPage"));
const PipelinesPage = React.lazy(() =>
import("./components/pipelines/PipelinesPage")
);
const BrowseDataPage = React.lazy(() =>
import("./components/browse-data/BrowseDataPage")
);
const FileDetailsPage = React.lazy(() =>
import("./components/browse-data/files/FileDetailsPage")
);
const TransferDataPage = React.lazy(() =>
import("./components/transer-data/TransferDataPage")
);
const DataOverviewPage = React.lazy(() =>
import("./components/data-overview/DataOverviewPage")
);
const DataExplorationPage = React.lazy(() =>
import("./components/data-exploration/DataExplorationPage")
);
export default function App() {
const classes = useRootStyles();
return (
<Router history={history}>
<SWRConfig
value={{
fetcher: apiFetch,
shouldRetryOnError: false,
revalidateOnFocus: false
}}
>
<QueryParamProvider ReactRouterRoute={Route}>
<div className={classes.root}>
<CIDCThemeProvider>
<ErrorGuard>
<InfoProvider>
<IdentityProvider>
<Header />
<div className={classes.content}>
<React.Suspense fallback={null}>
<Switch>
<Route
exact
path="/"
component={HomePage}
/>
<Route
path="/analyses"
component={
AnalysesDocsPage
}
/>
<Route
exact
path="/browse-data/:fileId"
component={
FileDetailsPage
}
/>
<Route
exact
path="/browse-data"
component={
BrowseDataPage
}
/>
<Route
exact
path="/transfer-data"
component={
TransferDataPage
}
/>
<Route
exact
path="/data-overview"
component={
DataOverviewPage
}
/>
<Route
exact
path="/data-exploration"
component={
DataExplorationPage
}
/>
<Route
exact
path="/manifests"
component={
ManifestsPage
}
/>
<Route
path="/pipelines"
component={
PipelinesPage
}
/>
<Route
exact
path="/schema"
component={SchemaPage}
/>
<Route
exact
path="/privacy-security"
component={
PrivacyAndSecurityPage
}
/>
<Route
exact
path="/profile"
component={ProfilePage}
/>
<Route
exact
path="/register"
component={Register}
/>
<Route
path="*"
component={
NotFoundRoute
}
/>
</Switch>
</React.Suspense>
</div>
<Footer />
</IdentityProvider>
</InfoProvider>
</ErrorGuard>
</CIDCThemeProvider>
</div>
</QueryParamProvider>
</SWRConfig>
</Router>
);
}