commit | author | age
|
2bcf3e
|
1 |
import React, { Component } from 'react'; |
MC |
2 |
import Structure from './MainStructure' |
|
3 |
import HistoricalDataForm from './HistoricalDataForm' |
|
4 |
import WelcomePage from './Welcome' |
|
5 |
import SingleCurrencyExchange from './SingleCurrencyExchange' |
|
6 |
import NewsBoard from './NewsBoard' |
|
7 |
|
|
8 |
import { |
|
9 |
BrowserRouter as Router, |
|
10 |
Switch, |
|
11 |
Route, |
|
12 |
} from "react-router-dom"; |
|
13 |
|
|
14 |
|
|
15 |
class App extends Component { |
|
16 |
render() { |
|
17 |
var enableNews = process.env.REACT_APP_NEWS_ENABLED |
|
18 |
return ( |
|
19 |
<Router basename="/frontend"> |
|
20 |
<Switch> |
|
21 |
<Structure> |
|
22 |
<Route path="/" exact > |
|
23 |
<WelcomePage /> |
|
24 |
</Route> |
|
25 |
<Route path="/exchange" exact> |
|
26 |
<SingleCurrencyExchange /> |
|
27 |
</Route> |
|
28 |
<Route path="/history" exact> |
|
29 |
<HistoricalDataForm /> |
|
30 |
</Route> |
|
31 |
{enableNews && |
|
32 |
<Route path="/news" exact> |
|
33 |
<NewsBoard /> |
|
34 |
</Route> |
|
35 |
} |
|
36 |
</Structure> |
|
37 |
</Switch> |
|
38 |
</Router> |
|
39 |
) |
|
40 |
} |
|
41 |
} |
|
42 |
|
|
43 |
export default App; |