|
1
|
import React from 'react'; |
|
2
|
import { Switch, Route } from 'react-router-dom'; |
|
3
|
import routes from '../shared/routes'; |
|
4
|
import { AppProps } from './App'; |
|
5
|
|
|
6
|
const mainStyle = { |
|
7
|
marginTop: 20, |
|
8
|
marginBottom: 20, |
|
9
|
marginLeft: 5, |
|
10
|
marginRight: 5, |
|
11
|
color: '#fff', |
|
12
|
font: '11pt "Helvetica Neue", "Helvetica", Arial, sans-serif', |
|
13
|
}; |
|
14
|
|
|
15
|
const contentStyle = { |
|
16
|
borderRadius: '20px!important', |
|
17
|
backgroundColor: 'rgba(52, 52, 52, 0.6)' |
|
18
|
} |
|
19
|
|
|
20
|
const Main = (props: AppProps) => { |
|
21
|
|
|
22
|
// console.log('MAIN', props.initialData); |
|
23
|
|
|
24
|
return ( |
|
25
|
<main style={mainStyle}> |
|
26
|
<section className="py-5 text-center container"> |
|
27
|
<div className="row py-lg-5"> |
|
28
|
<div className="col-lg-6 col-md-8 mx-auto" style={contentStyle}> |
|
29
|
<Switch> |
|
30
|
{ |
|
31
|
routes.map((route, index) => ( |
|
32
|
<Route key={index} exact={route.exact} path={route.path} > |
|
33
|
<route.component |
|
34
|
firebase={props.firebase} |
|
35
|
initialData={props.initialData} |
|
36
|
/> |
|
37
|
</Route> |
|
38
|
)) |
|
39
|
} |
|
40
|
</Switch> |
|
41
|
</div> |
|
42
|
</div> |
|
43
|
</section> |
|
44
|
</main> |
|
45
|
)}; |
|
46
|
|
|
47
|
export default Main; |