-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
59 lines (57 loc) · 2.15 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
import { Container, Grid } from '@mui/material'
import { FrontPage } from './components/FrontPage'
import { MapPage } from './components/MapPage'
import { NavBar } from './components/NavBar'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { Login } from './components/Login'
import {
crossSearchPage,
localityPage,
personPage,
projectPage,
referencePage,
regionPage,
speciesPage,
timeBoundPage,
timeUnitPage,
} from './components/pages'
import { Notification, NotificationContextProvider } from './components/Notification'
import { EmailPage } from './components/EmailPage'
import { ENV } from './util/config'
const App = () => {
return (
<BrowserRouter>
<NotificationContextProvider>
<Notification />
<Grid container>
<Grid item xs={12}>
<Container maxWidth="xl">
<NavBar />
</Container>
</Grid>
<Container maxWidth="xl" fixed style={{ marginTop: '2em', marginBottom: '2em' }}>
<Grid item>
<Routes>
<Route element={crossSearchPage} path="/crosssearch/:id?" />
<Route element={localityPage} path="/locality/:id?" />
<Route element={speciesPage} path="/species/:id?" />
<Route element={referencePage} path="/reference/:id?" />
<Route element={timeUnitPage} path="/time-unit/:id?" />
<Route element={timeBoundPage} path="/time-bound/:id?" />
<Route element={regionPage} path="/region/:id?" />
<Route element={personPage} path="/person/:id?" />
<Route element={projectPage} path="/project/:id?" />
<Route element={<EmailPage />} path="/email/" />
<Route element={<Login />} path="/login" />
<Route element={<FrontPage />} path="/" />
{ENV == 'dev' && <Route element={<MapPage />} path="/map" />}
<Route element={<div>Page not found.</div>} path="*" />
</Routes>
</Grid>
</Container>
</Grid>
</NotificationContextProvider>
</BrowserRouter>
)
}
export default App