From f269caf1eb36c43269d92c89b7f0b0bafb88d572 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Mon, 22 Apr 2019 23:58:44 -0400 Subject: switched tabs to 2 spaces --- mobile/screens/MapPage.js | 154 +++++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 78 deletions(-) (limited to 'mobile/screens/MapPage.js') diff --git a/mobile/screens/MapPage.js b/mobile/screens/MapPage.js index f8e2a79..7cdb873 100644 --- a/mobile/screens/MapPage.js +++ b/mobile/screens/MapPage.js @@ -14,86 +14,84 @@ import {MapView} from 'expo'; export default class Form1 extends Component { - constructor(props) { - super(props); - this.state = { - initial_region_coordinates: [-79.3832, 43.6532], - markers: [], - canProceed: false, - } - } - - addMarker(e) { - this.setState( - { markers : [{ latlng: e.nativeEvent.coordinate}], canProceed: true} - ); - } - deleteMarker() { - this.setState( - { markers : [], canProceed: false} - ); - } - moveToFormPage = () => { - if(this.state.canProceed === false) { - alert("Please press on the map to drop a pin"); - return; - } - this.props.navigation.navigate('FormPage', - {coordinates : [ - this.state.markers[0].latlng.longitude, - this.state.markers[0].latlng.latitude] - }); - }; - moveToGreetingPage = () => { - this.props.navigation.navigate('GreetingPage'); - } + constructor(props) { + super(props); + this.state = { + initial_region_coordinates: [-79.3832, 43.6532], + markers: [], + canProceed: false, + } + } + addMarker(e) { + this.setState( + { markers : [{ latlng: e.nativeEvent.coordinate}], canProceed: true} + ); + } + deleteMarker() { + this.setState( + { markers : [], canProceed: false} + ); + } + moveToFormPage = () => { + if(this.state.canProceed === false) { + alert("Please press on the map to drop a pin"); + return; + } + this.props.navigation.navigate('FormPage', + {coordinates : [ + this.state.markers[0].latlng.longitude, + this.state.markers[0].latlng.latitude] + }); + }; + moveToGreetingPage = () => { + this.props.navigation.navigate('GreetingPage'); + } - render() { - return ( - - - + render() { + return ( + + + - { - this.state.markers.map((marker, i) => ( {e.stopPropagation(); this.deleteMarker(i)}} />)) - } - - + { + this.state.markers.map((marker, i) => ( {e.stopPropagation(); this.deleteMarker(i)}} />)) + } + + - { this.moveToFormPage() }}> - - Proceed - - - { this.moveToGreetingPage() }}> - - Back - - - - ); + { this.moveToFormPage() }}> + + Proceed + + + { this.moveToGreetingPage() }}> + + Back + + + + ); } - } const styles = StyleSheet.create( { - first_button_container: { - width: '100%', - flex: 1, - position: 'absolute', + first_button_container: { + width: '100%', + flex: 1, + position: 'absolute', bottom:60, backgroundColor: '#c0392b', flexDirection: 'row', @@ -101,9 +99,9 @@ const styles = StyleSheet.create( { alignItems: 'stretch' }, second_button_container: { - width: '100%', - flex: 1, - position: 'absolute', + width: '100%', + flex: 1, + position: 'absolute', bottom:0, backgroundColor: '#535c68', flexDirection: 'row', @@ -118,4 +116,4 @@ const styles = StyleSheet.create( { opacity: 0.9, fontSize: 20 } -}) \ No newline at end of file +}) -- cgit v1.2.3