-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
59 lines (49 loc) · 1.27 KB
/
App.js
File metadata and controls
59 lines (49 loc) · 1.27 KB
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
import React, { Component } from "react";
import { StyleSheet, View } from "react-native";
import firebase from "@firebase/app";
import "@firebase/database";
import { updateBluetooth } from "./src/BluetoothIngest";
import { connect } from "react-redux";
import AppNavigator from "./navigation/AppNavigator";
//Root component of the app. Calls AppNavigator to
//initialize the react-navigation components responsible
//for displaying the screens of the app. Also initializes the
//Firebase object and updates Bluetooth data periodically.
class YourApp extends Component {
componentWillMount() {
const config = {
//ADD CONFIG HERE (Removed for security purposes)
};
firebase.initializeApp(config);
console.log("Firestore Initialized");
console.disableYellowBox = true;
setInterval(() => {
if (this.props.profile.collectingData) {
updateBluetooth();
}
}, 250);
}
render() {
return (
<View style={styles.container}>
<AppNavigator />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
}
});
//Redux functions
function mapStateToProps(state) {
return {
profile: state.profile
};
}
export default connect(
mapStateToProps,
null
)(YourApp);