Skip to content

Commit 6f2301d

Browse files
committed
Added habitats & species
1 parent d9bc0d0 commit 6f2301d

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

src/routes.js

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { addonRoutes } from '~/config';
1414
*/
1515
const routes = [
1616
{
17-
path: '/natura2000/sites/c/:site_code',
17+
path: '/natura2000/sites/natura2000/:site_code',
1818
realPathname: '/natura2000/sites/site',
19-
theme: 'n2k',
19+
theme: 'natura2000',
2020
component: FakeLocation,
2121
renderComponent: App,
2222
routes: [
@@ -32,9 +32,72 @@ const routes = [
3232
})),
3333
],
3434
},
35+
{
36+
path: '/natura2000/sites/cdda/:site_code',
37+
realPathname: '/natura2000/sites/site_cdda',
38+
theme: 'natura2000',
39+
component: FakeLocation,
40+
renderComponent: App,
41+
routes: [
42+
// Add your routes here
43+
// addon routes have a higher priority then default routes
44+
...defaultRoutes.map((route) => ({
45+
...route,
46+
...(route.path === '/**' ? { path: route.path + '/:site_code' } : {}),
47+
...(route.path === '/**/edit' ? { path: '/**/:site_code/edit' } : {}),
48+
realPathname: '/natura2000/sites/site_cdda',
49+
component: FakeLocation,
50+
renderComponent: route.component,
51+
})),
52+
],
53+
},
54+
{
55+
path: '/natura2000/habitats/h/:code_2000',
56+
realPathname: '/natura2000/habitats/habitat',
57+
theme: 'natura2000',
58+
component: FakeLocation,
59+
renderComponent: App,
60+
routes: [
61+
// Add your routes here
62+
// addon routes have a higher priority then default routes
63+
...defaultRoutes.map((route) => ({
64+
...route,
65+
...(route.path === '/**' ? { path: route.path + '/:code_2000' } : {}),
66+
...(route.path === '/**/edit' ? { path: '/**/:code_2000/edit' } : {}),
67+
realPathname: '/natura2000/habitats/habitat',
68+
component: FakeLocation,
69+
renderComponent: route.component,
70+
})),
71+
],
72+
},
73+
{
74+
path: '/natura2000/species/s/:id_eunis',
75+
realPathname: '/natura2000/species/species',
76+
theme: 'natura2000',
77+
component: FakeLocation,
78+
renderComponent: App,
79+
routes: [
80+
// Add your routes here
81+
// addon routes have a higher priority then default routes
82+
...defaultRoutes.map((route) => ({
83+
...route,
84+
...(route.path === '/**' ? { path: route.path + '/:id_eunis' } : {}),
85+
...(route.path === '/**/edit' ? { path: '/**/:id_eunis/edit' } : {}),
86+
realPathname: '/natura2000/species/species',
87+
component: FakeLocation,
88+
renderComponent: route.component,
89+
})),
90+
],
91+
},
92+
/**
93+
* sites/site
94+
* sites/site_cdda
95+
* habitats/habitat
96+
* species/species
97+
*/
3598
{
3699
path: '/natura2000',
37-
theme: 'n2k',
100+
theme: 'natura2000',
38101
component: App, // Change this if you want a different component
39102
routes: [
40103
// Add your routes here

0 commit comments

Comments
 (0)