-
Notifications
You must be signed in to change notification settings - Fork 9
/
routes.tsx
59 lines (56 loc) · 2.17 KB
/
routes.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
import { Config } from '@/config/config';
import { notFoundRoute } from '@/notFoundPage';
import { notImplementedRoutes } from '@/notImplementedRoutes';
import { applyReactRouterPlugins } from '@/reactRouterPlugins';
import { collectionKeyRoute } from '@/routes/collection/key';
import { collectionSearchRoute } from '@/routes/collection/search';
import { datasetKeyRoute } from '@/routes/dataset/key';
import { datasetSearchRoute } from '@/routes/dataset/search';
import { installationKeyRoute } from '@/routes/installation/key';
import { institutionKeyRoute } from '@/routes/institution/key';
import { institutionSearchRoute } from '@/routes/institution/search';
import { literatureSearchRoute } from '@/routes/literature/search';
import { networkKeyRoute } from '@/routes/network/key';
import { occurrenceKeyRoutes } from '@/routes/occurrence/key';
import { occurrenceSearchRoute } from '@/routes/occurrence/search';
import { publisherKeyRoute } from '@/routes/publisher/key';
import { publisherSearchRoute } from '@/routes/publisher/search';
import { resourceKeyRoutes } from '@/routes/resource/key';
import { RootErrorPage } from '@/routes/rootErrorPage';
import { Outlet } from 'react-router-dom';
import { HpRootLayout } from './hpRootLayout';
export function createHostedPortalRoutes(config: Config) {
return applyReactRouterPlugins(
[
{
element: <HpRootLayout children={<Outlet />} />,
children: [
{
errorElement: <RootErrorPage />,
children: [
// search routes first
collectionSearchRoute,
institutionSearchRoute,
publisherSearchRoute,
literatureSearchRoute,
occurrenceSearchRoute,
// then key routes
collectionKeyRoute,
datasetSearchRoute,
datasetKeyRoute,
institutionKeyRoute,
...occurrenceKeyRoutes,
publisherKeyRoute,
installationKeyRoute,
networkKeyRoute,
...resourceKeyRoutes,
...notImplementedRoutes,
notFoundRoute,
],
},
],
},
],
config
);
}