routes.ts 1.51 KB
Newer Older
1
2
import Loading from 'ui/common/Loading';
import * as Loadable from 'react-loadable';
3
4
5
6

const publicRoutes = [
  {
    path: '/requests',
7
8
9
10
    component: Loadable({
      loader: () => import(/* webpackMode:"lazy", webpackChunkName: "requests" */'requests/ui/StepperPage'),
      loading: Loading,
    }),
11
12
13
14
    extraProps: {
      title: 'Requesting material from holding institutes',
    },
    routes: [
15
16
17
18
      ...Loadable({
        loader: () => import(/* webpackMode:"lazy", webpackChunkName: "requests" */'requests/ui/request-stepper/steps'),
        loading: Loading,
      }),
19
20
21
22
    ],
  },
];

23
const adminRoutes = [
24
25
26
27
28
29
30
31
32
33
34
  {
    path: '/requests/:filterCode(v.+)?',
    component: Loadable({
      loader: () => import(/* webpackMode:"lazy", webpackChunkName: "requests" */'requests/ui/admin/BrowsePage'),
      loading: Loading,
    }),
    exact: true,
    extraProps: {
      title: 'Requests',
    },
  },
35
36
  {
    path: '/requests',
37
38
39
40
    component: Loadable({
      loader: () => import(/* webpackMode:"lazy", webpackChunkName: "requests" */'requests/ui/admin/BrowsePage'),
      loading: Loading,
    }),
41
42
43
44
45
46
47
    exact: true,
    extraProps: {
      title: 'Requests',
    },
  },
  {
    path: '/requests/:uuid',
48
49
50
51
    component: Loadable({
      loader: () => import(/* webpackMode:"lazy", webpackChunkName: "requests" */'requests/ui/admin/DisplayPage'),
      loading: Loading,
    }),
52
53
54
55
56
57
58
    exact: true,
    extraProps: {
      title: 'Request info',
    },
  },
];

59
export {adminRoutes as requestsAdminRoutes, publicRoutes as requestPublicRoutes};