-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.js
65 lines (57 loc) · 1.33 KB
/
Home.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
'use strict';
import React, { Component } from 'react'
import {
View,
Button,
StyleSheet,
Text
} from 'react-native';
import BackgroundGeolocation from "react-native-background-geolocation";
var GeoFenceList = require('./GeoFenceList');
var DB = require('./db.js');
// var DBEvents = require('react-native-db-models').DBEvents
class Home extends Component {
openGeoFenceList() {
BackgroundGeolocation.getGeofences((geoFences) => {
this.props.navigator.push({
title: 'GeoFences',
component: GeoFenceList,
passProps: {geoFences: geoFences}
});
});
}
render() {
console.log('home.render');
return (
<View style={styles.container}>
<Button
style={styles.button}
onPress={this.openGeoFenceList.bind(this)}
title="View Geofences"
color="#841584"
accessibilityLabel="Learn more about this purple button"
/>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
padding: 30,
marginTop: 65,
alignItems: 'center'
},
button: {
height: 36,
flex: 1,
flexDirection: 'row',
backgroundColor: '#48BBEC',
borderColor: '#48BBEC',
borderWidth: 1,
borderRadius: 8,
marginBottom: 10,
alignSelf: 'stretch',
justifyContent: 'center'
}
});
module.exports = Home;