Skip to content

Commit 0ac65a2

Browse files
committed
adding menu overlay
1 parent 4f34e8e commit 0ac65a2

File tree

9 files changed

+73
-6
lines changed

9 files changed

+73
-6
lines changed

public/forest.png

18.1 KB
Loading

public/log.png

20.6 KB
Loading

public/sprout.png

19.9 KB
Loading

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class App extends React.Component {
77
constructor(props) {
88
super(props);
99
this.state = {
10-
loading: true,
10+
loading: false,
1111
}
1212
}
1313

src/Login/Login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class Login extends React.Component {
77
constructor(props) {
88
super(props);
99
this.state = {
10-
loggedIn: false,
10+
loggedIn: true,
1111
}
1212
}
1313

src/Map/Map.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import L from 'leaflet'
33
import { Map as LeafletMap, TileLayer, Marker } from 'react-leaflet'
44
import Markers from './Markers'
55
import TreeInfo from '../TreeInfo'
6+
import Menu from '../Menu'
67
import './Map.css';
78

9+
import { Pane } from 'evergreen-ui'
10+
811
class Map extends Component {
912
constructor() {
1013
super()
@@ -13,7 +16,7 @@ class Map extends Component {
1316
lat: -33.883006,
1417
lng: 151.206536,
1518
zoom: 15,
16-
showMap: false,
19+
showMap: true,
1720
}
1821
}
1922

@@ -35,8 +38,9 @@ class Map extends Component {
3538

3639
render() {
3740
const position = [this.state.lat, this.state.lng];
38-
return (
39-
this.state.showMap ? <LeafletMap center={position} zoom={this.state.zoom}>
41+
return (<Pane>
42+
<Menu />
43+
{this.state.showMap ? <LeafletMap center={position} zoom={this.state.zoom}>
4044
<TileLayer
4145
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
4246
url='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'
@@ -58,7 +62,9 @@ class Map extends Component {
5862
<Marker position={Markers.markerPos14} onClick={this.handleClick} icon={this.treeIcon} />
5963
<Marker position={Markers.markerPos15} onClick={this.handleClick} icon={this.treeIcon} />
6064
<Marker position={Markers.markerPos16} onClick={this.handleClick} icon={this.treeIcon} />
61-
</LeafletMap> : <TreeInfo onClose={this.handleClose} />
65+
</LeafletMap> : <TreeInfo onClose={this.handleClose} />}
66+
67+
</Pane>
6268
);
6369
}
6470
}

src/Menu/MenuButton.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, { Component } from 'react'
2+
import { Text, Pane } from 'evergreen-ui'
3+
4+
5+
import './index.css';
6+
7+
export default class MenuButton extends Component {
8+
constructor(props) {
9+
super(props);
10+
}
11+
12+
render() {
13+
return (
14+
<Pane display="flex" flexDirection="column" className="menu-button">
15+
<img src={this.props.source} className="menu-button-icon" />
16+
<Text marginTop={5} size={100}>{this.props.text}</Text>
17+
</Pane>
18+
);
19+
}
20+
}

src/Menu/index.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.menu {
2+
position: absolute;
3+
z-index: 9999;
4+
bottom: 0;
5+
6+
7+
background-color: #C2D796;
8+
}
9+
10+
.menu-button {
11+
height: 65px
12+
}
13+
14+
.menu-button-icon {
15+
height: 40px;
16+
object-fit: contain;
17+
}

src/Menu/index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React, { Component } from 'react'
2+
import { Heading, Checkbox, Paragraph, Button, Pane } from 'evergreen-ui'
3+
4+
import MenuButton from './MenuButton'
5+
6+
import './index.css';
7+
8+
export default class Menu extends Component {
9+
constructor(props) {
10+
super(props);
11+
}
12+
13+
render() {
14+
15+
16+
return (
17+
<Pane display="flex" flexDirection="row" className="menu" paddingTop={10} paddingBottom={10} height={80} justifyContent="space-around" width="100%">
18+
<MenuButton source="./forest.png" text="The Forest" />
19+
<MenuButton source="./log.png" text="My Log" />
20+
<MenuButton source="./sprout.png" text="My Growth" />
21+
</Pane>
22+
);
23+
}
24+
}

0 commit comments

Comments
 (0)