diff --git a/Map.js b/Map.js index 82c63d2..d78a695 100644 --- a/Map.js +++ b/Map.js @@ -1,5 +1,6 @@ import React, {Component} from 'react'; -import { Platform, StyleSheet, Text, View, Button, Picker, Alert } from 'react-native'; +import { Platform, StyleSheet, Text, View, Button, Picker, Alert, + TouchableOpacity } from 'react-native'; import {Permissions, Location, Font} from 'expo'; import MapView from 'react-native-maps'; import PopupDialog from 'react-native-popup-dialog'; @@ -24,6 +25,10 @@ export class Map extends Component { constructor(props) { super(props); + console.ignoredYellowBox = [ + 'Setting a timer' + ] + this.state = { userRegion: { latitude: 32.8801, @@ -117,9 +122,11 @@ export class Map extends Component { //calls getLocation method after map is rendered async componentDidMount() { this._getLocationAsync(); + console.log("Loading Font Awesome...") await Font.loadAsync({ - fontAwesome: require('./fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf'), + FontAwesome: require('./fonts/font-awesome-4.7.0/fonts/FontAwesome.otf') }); + console.log("Font Awesome loaded!") this.setState({ fontLoaded: true }); } @@ -225,70 +232,89 @@ export class Map extends Component { - { _map = mapView; }} - style={styles.container} - onRegionChange={this._handleMapRegionChange} - region={this.state.mapRegion} - showUserLocation={true} - initialRegion = {{ - latitude: 32.8801, - longitude: -117.2340, - latitudeDelta: 0.0422, - longitudeDelta: 0.0221 - }} - showsUserLocation={true} - onLongPress={e => this._createMarker(e.nativeEvent.coordinate.latitude, e.nativeEvent.coordinate.longitude, 'marker') - } - > - {this.state.renderedMarkers.map(marker => ( - (this.marker = marker)} - key={marker.key} - image={this._setMarkerImg(marker.tag)} - coordinate={marker.coordinate} - onPress={() => { - this.showEventModal(marker); - }} /> - ))} - - - {Icons.list} - - ) : null} - degrees={Number(0)} - onPress= {this.showFilterModal}> - - - {Icons.compass} - - ) : null} - degrees={Number(0)} - onPress= {() =>_map.animateToRegion(this.state.userRegion, 500)}> - - - - Choose Filter - this.setState({tag: itemValue})}> - - - - - - - - + { _map = mapView; }} + style={styles.container} + onRegionChange={this._handleMapRegionChange} + region={this.state.mapRegion} + showUserLocation={true} + initialRegion = {{ + latitude: 32.8801, + longitude: -117.2340, + latitudeDelta: 0.0422, + longitudeDelta: 0.0221 + }} + showsUserLocation={true} + onLongPress={e => this._createMarker(e.nativeEvent.coordinate.latitude, e.nativeEvent.coordinate.longitude, 'marker') + } + > + {this.state.renderedMarkers.map(marker => ( + (this.marker = marker)} + key={marker.key} + image={this._setMarkerImg(marker.tag)} + coordinate={marker.coordinate} + onPress={() => { + this.showEventModal(marker); + }} /> + ))} + + + + + + + {this.state.fontLoaded ? ( + {Icons.list} + ) : null} + + + + _map.animateToRegion(this.state.userRegion, 499)} + > + + {this.state.fontLoaded ? ( + {Icons.compass} + ) : null} + + + + + + {this.state.fontLoaded ? ( + {Icons.user} + ) : null} + + + + + + + + Choose Filter + this.setState({tag: itemValue})}> + + + + + + + + + @@ -297,59 +323,53 @@ export class Map extends Component { Tag: {this.state.selectedEvent.tag} Score: {this.state.selectedEvent.score} - - - {Icons.thumbsUp} + + + this.thumbsUpEvent()} + > + + {this.state.fontLoaded ? ( + {Icons.thumbsUp} + ) : null} - ) : null} - degrees={Number(0)} - buttonColor="#0F0" - onPress={() => this.thumbsUpEvent()}> - + - - - {Icons.thumbsDown} + + + this.thumbsDownEvent()} + > + + {this.state.fontLoaded ? ( + {Icons.thumbsDown} + ) : null} - ) : null} - buttonColor="#F00" - degrees={Number(0)} - onPress={() => this.thumbsDownEvent()}> - + - - - {Icons.exclamation} - - ) : null} - buttonColor="gray" - degrees={Number(0)} - onPress={() => this.report()}> - - + + + + + this.report()} + > + + {this.state.fontLoaded ? ( + {Icons.exclamation} + ) : null} + + + + {this._popup = popup;}} db={firebase}/> - - {Icons.user} - - ) : null} - degrees={Number(0)} - onPress= {this.showAccount.bind(this)}> - + ); } @@ -359,6 +379,7 @@ export class Map extends Component { const styles = StyleSheet.create({ container: { + position: 'absolute', flex: 1, backgroundColor: '#fff', alignItems: 'center', @@ -366,19 +387,22 @@ const styles = StyleSheet.create({ height: '100%', width: '100%', }, - centerButton: { + bottomBar: { position: 'absolute', - width: 20, - height: 20, - top: '80%', - left: '80%', + flex: 1, + flexDirection: 'row', + justifyContent: 'center', + bottom: '2%' + }, + centerButton: { + position: 'relative', + borderRadius: 20, + margin: 5 }, filterButton: { - position: 'absolute', - width: 20, - height: 20, - top: 10, - left: '80%', + position: 'relative', + borderRadius: 20, + margin: 5 }, thumbsUpButton: { width: 20, @@ -406,11 +430,8 @@ const styles = StyleSheet.create({ backgroundColor: '#fff', }, accountButton: { - position: 'absolute', - width: 20, - height: 20, - top: 10, - left: '10%', + borderRadius:20, + margin: 5 }, eventName: { fontSize: 30, @@ -419,7 +440,6 @@ const styles = StyleSheet.create({ marginTop: 15, }, eventDetails: { - fontFamily: 'Helvetica', fontSize: 20, color: '#616a77', fontWeight: '300', diff --git a/package.json b/package.json index 40fd44a..4355125 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "react-native-modal": "^4.1.1", "react-native-modal-datetime-picker": "^4.13.0", "react-native-popup-dialog": "^0.9.39", + "react-native-router-flux": "^4.0.0-beta.24", "react-native-web": "^0.1.13", "watchman": "^0.1.8" }