-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
66 lines (55 loc) · 1.68 KB
/
index.ios.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
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
AppRegistry,
View,
} from 'react-native';
import Information from './app/components/Information';
import MetroMap from './app/components/MetroMap';
import DirectionsBar from './app/components/DirectionsBar';
export default class letsGoMetro extends Component {
constructor(){
super();
this.state = {
polylineCoord: [{latitude: 0, longitude: 0}, {latitude: 0, longitude: 0}],
transitDetails: [],
stepsArr: [],
lastPt: {latitude: 0, longitude: 0}
};
this.updatePolylineCoord = this.updatePolylineCoord.bind(this);
this.setMarkers = this.setMarkers.bind(this);
}
componentDidUpdate(){
console.log('THIS IS STATE INSIDE PARENT GOOGLE GOOGLE MOOGLE SHOOGLE');
console.log(this.state);
}
updatePolylineCoord(arr){
this.setState({
polylineCoord: arr
});
}
setMarkers(arr, stepsArr, lastPt){
this.setState({
transitDetails: arr,
stepsArr: stepsArr,
lastPt: lastPt
});
}
render() {
return (
<View style={{flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center'}}>
<Information />
<MetroMap polylineCoord={this.state.polylineCoord} transitDetails={this.state.transitDetails} stepsArr={this.state.stepsArr} lastPt={this.state.lastPt} />
<DirectionsBar updatePolylineCoord={this.updatePolylineCoord} setMarkers={this.setMarkers} />
</View>
);
}
}
// const styles = StyleSheet.create({
// welcome: {
// fontSize: 20,
// textAlign: 'center',
// margin: 10,
// },
// });
AppRegistry.registerComponent('letsGoMetro', () => letsGoMetro);