/
App.js
69 lines (60 loc) 路 1.32 KB
/
App.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
import React from 'react'
import { Root, Link, Route, Switch } from 'react-static'
import styled, { injectGlobal } from 'styled-components'
//
import Home from 'containers/Home'
import Geolocation from 'containers/Geolocation'
import NotFound from 'containers/404'
injectGlobal`
body {
font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial,
'Lucida Grande', sans-serif;
font-weight: 300;
font-size: 16px;
margin: 0;
padding: 0;
}
`
const AppStyles = styled.div`
a {
text-decoration: none;
color: #108db8;
font-weight: bold;
}
nav {
width: 100%;
background: #108db8;
padding-top: constant(safe-area-inset-top);
a {
color: white;
padding: 1rem;
display: inline-block;
}
}
.content {
padding: 1rem;
}
img {
max-width: 100%;
}
`
const App = () => (
<Root type="hash">
<AppStyles>
<nav>
<Link exact to="/">
Home
</Link>
<Link to="/geolocation">Geolocation</Link>
</nav>
<div className="content">
<Switch>
<Route exact path="/" component={Home} />
<Route path="/geolocation" component={Geolocation} />
<Route component={NotFound} />
</Switch>
</div>
</AppStyles>
</Root>
)
export default App