-
Notifications
You must be signed in to change notification settings - Fork 9
/
routes.js
96 lines (85 loc) · 3.42 KB
/
routes.js
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
// make the routes easier to read
/*eslint react/jsx-sort-props:0*/
import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import {
WordpressPage,
WordpressPostList,
WordpressPost,
} from './containers/wordpress';
import Homepage from './containers/homepage';
import Layout from './containers/layout';
import Search from './containers/search';
import GenePage from './containers/genePage';
import GeneAlleleDetailsPage from './containers/GeneAlleleDetailsPage';
import DiseasePage from './containers/diseasePage';
import NotFound from './components/notFound';
import DownloadsPage from './containers/downloadsPage';
import AllelePage from './containers/allelePage/AllelePage';
import VariantPage from './containers/allelePage/VariantPage';
import MODLanding from './containers/modLanding/Main';
import AlzheimersPage from './containers/alzheimersPage';
export default (
<Layout>
<Switch>
<Route exact path='/' component={Homepage} />
<Route exact path='/search' component={Search} />
<Route exact path='/gene/:id' render={({match}) => <GenePage geneId={match.params.id} />} />
<Route exact path='/gene/:id/allele-details' render={({match}) => <GeneAlleleDetailsPage geneId={match.params.id} />} />
<Route exact path='/disease/:id' render={({match}) => <DiseasePage diseaseId={match.params.id} />} />
<Route exact path='/allele/:id' render={({match}) => <AllelePage alleleId={match.params.id} />} />
<Route exact path='/variant/:id' render={({match}) => <VariantPage variantId={match.params.id} />} />
<Route exact path='/news/:slug' render={({match}) => <WordpressPost slug={match.params.slug} />} />
<Route exact path='/news' component={WordpressPostList} />
<Route exact path='/downloads' component={DownloadsPage} />
<Route exact path='/members/:id' render={({ match }) => <MODLanding modId={match.params.id} />} />
<Route exact path='/disease-portal/alzheimers-disease' component={AlzheimersPage} />
{/* this one needs to be handled outside of the main application */}
<Route
path='/api'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Route
path='/swagger-ui'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Route
path='/openapi'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Route
path='/bluegenes'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Route
path='/jbrowse'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Route
path='/apollo'
render={(props) => {
window.location.href = `${props.location.pathname}${props.location.search}`;
return null;
}}
/>
<Redirect exact from='/wordpress/:slug' to='/:slug' />
<Route path='/:slug' render={({match}) => <WordpressPage slug={match.params.slug} />} />
<Route component={NotFound} />
</Switch>
</Layout>
);