-
{`Confidence: ${this.props.detail.confidence}`}
-
{`When: ${this.props.detail.date}, ${this.props.detail.time}`}
-
{`Where: ${this.props.detail.lat} degrees N, and ${this.props.detail.lng} degrees E`}
+
Type: {this.getType(this.props.detail.type)}
+
When: {this.formatDate(this.props.detail.date)}, {this.getTime(this.props.detail.time)}
+
Where: {this.props.detail.lat} degrees N, and {this.props.detail.lng} degrees E
+
I am confident of my sighting: {this.getConfidence(this.props.detail.confidence)}
+
{`${this.props.detail.desc}`}
+
@@ -33,6 +33,4 @@ export class MapContainer extends Component {
}
// Send the Google Map API Key with the MapContainer component
-export default GoogleApiWrapper({
- apiKey: (API_KEY)
-})(MapContainer)
\ No newline at end of file
+export default GoogleApiWrapper({ apiKey: (API_KEY) })(MapContainer);
\ No newline at end of file
diff --git a/src/components/SightingMap.js b/src/components/SightingMap.js
index 2d00465..85b7410 100644
--- a/src/components/SightingMap.js
+++ b/src/components/SightingMap.js
@@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import { Map, InfoWindow, Marker, GoogleApiWrapper } from 'google-maps-react';
-import moment from 'moment'
+import moment from 'moment';
import Typography from '@material-ui/core/Typography';
import firebase from '../firebase.js';
@@ -11,7 +11,7 @@ const API_KEY = 'AIzaSyAZ_0J01bA6wCbIPK4UBq2RUBC-hIqG4mM';
const mapStyles = {
width: '100%',
height: '100%'
-}
+};
/**
* Types of sightings. Label is what is
@@ -81,23 +81,23 @@ const timeTypes = [
const confidenceLevels = [
{
value: '1',
- label: '1 - Strongly unconfident',
+ label: '1 - Strongly disagree',
},
{
value: '2',
- label: '2 - Unconfident',
+ label: '2 - Disagree',
},
{
value: '3',
- label: '3 - Somewhat confident',
+ label: '3 - Neutral',
},
{
value: '4',
- label: '4 - Confident',
+ label: '4 - Agree',
},
{
value: '5',
- label: '5 - Very confident',
+ label: '5 - Strongly agree',
},
];
@@ -112,9 +112,8 @@ export class MapContainer extends Component {
lat: position.coords.latitude,
lng: position.coords.longitude
}
- }
- );
- })
+ });
+ });
} else {
// If browser doesn't support geolocation or if user does not allow it,
// center map on Grand Rapids, Michigan
@@ -123,8 +122,7 @@ export class MapContainer extends Component {
lat: 42.9634,
lng: 85.6681
}
- }
- );
+ });
}
}
@@ -210,7 +208,7 @@ export class MapContainer extends Component {
}
formatDate = date => {
- return (moment(date, "YYYY-MM").format("MMMM YYYY").toString())
+ return (moment(date, "YYYY-MM").format("MMMM YYYY").toString());
}
// Set the state of the component to contain user coordinates and initial
@@ -224,7 +222,7 @@ export class MapContainer extends Component {
activeMarker: {},
selectedPlace: {},
sightings: []
- }
+ };
render() {
return (
@@ -236,7 +234,8 @@ export class MapContainer extends Component {
initialCenter={this.state.myLatLng}
center={this.state.myLatLng}
defaultZoom={15}
- onClick={this.onMapClick} >
+ onClick={this.onMapClick}
+ >
Confidence: {this.getConfidence(sighting.confidence)}}
date={Date: {this.formatDate(sighting.date)}}
time={Time: {this.getTime(sighting.time)}}
+ confidence={I am confident of my sighting: {this.getConfidence(sighting.confidence)}}
description={Description: {sighting.desc}}
/>
)
@@ -267,15 +266,15 @@ export class MapContainer extends Component {
{this.state.selectedPlace.type}
-
- {this.state.selectedPlace.confidence}
-
{this.state.selectedPlace.date}
{this.state.selectedPlace.time}
+
+ {this.state.selectedPlace.confidence}
+
{this.state.selectedPlace.description}
@@ -288,6 +287,4 @@ export class MapContainer extends Component {
}
// Send the Google Map API Key with the MapContainer component
-export default GoogleApiWrapper({
- apiKey: (API_KEY)
-})(MapContainer)
\ No newline at end of file
+export default GoogleApiWrapper({ apiKey: (API_KEY) })(MapContainer);
\ No newline at end of file
diff --git a/src/components/ViewSightings.js b/src/components/ViewSightings.js
index e245e6b..ec5d3c2 100644
--- a/src/components/ViewSightings.js
+++ b/src/components/ViewSightings.js
@@ -16,7 +16,7 @@ class ViewSightings extends Component {
let newState = [];
for (let sighting in sightings) {
- newState.push({
+ newState.unshift({
id: sighting,
lat: sightings[sighting].lat,
lng: sightings[sighting].lng,
@@ -62,7 +62,7 @@ class ViewSightings extends Component {
time: null
},
clicked: false
- }
+ };
render() {
return (
@@ -77,7 +77,7 @@ class ViewSightings extends Component {
this.getDetail(sighting.id, sighting.lat, sighting.lng, sighting.desc, sighting.type, sighting.confidence, sighting.date, sighting.time)}>
- )
+ );
})
}