-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
104 lines (95 loc) · 3.46 KB
/
App.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import React from 'react';
import {createAppContainer, createBottomTabNavigator, createStackNavigator} from 'react-navigation';
import {StyleSheet} from 'react-native';
import Icon from 'react-native-vector-icons/AntDesign';
import NfcManager from 'react-native-nfc-manager';
import DashboardScreen from './components/screens/DashboardScreen/DashboardScreen';
import ChecklistScreen from './components/screens/Checklist Screens/ChecklistScreen';
import CheckInScreen from './components/screens/Checklist Screens/CheckInScreen';
import ChecklistStartScreen from './components/screens/Checklist Screens/ChecklistStartScreen';
import ChoreStopwatchScreen from './components/screens/Checklist Screens/ChoreStopwatchScreen';
import TaskCompleteScreen from './components/screens/Checklist Screens/TaskCompleteScreen';
import StatisticsScreen from './components/screens/StatisticsScreen/StatisticsScreen';
import MessagesScreen from './components/screens/MessagesScreen/MessagesScreen';
const ChecklistStack = createStackNavigator({
Checklist: ChecklistScreen,
ChecklistStart: ChecklistStartScreen,
CheckIn: CheckInScreen,
ChoreStopwatch: ChoreStopwatchScreen,
TaskComplete: TaskCompleteScreen,
});
const AppContainer = createAppContainer(
createBottomTabNavigator({
Dashboard: {
screen: DashboardScreen,
navigationOptions: {
tabBarLabel: 'dashboard',
tabBarIcon: ({}) => (
<Icon name = 'dashboard' size = {28} color = 'gray' />
)
}
},
ChecklistStackNav: {
screen: ChecklistStack,
navigationOptions: {
tabBarLabel: 'checklist',
tabBarIcon: ({}) => (
<Icon name = 'checksquareo' size = {28} color = 'gray' />
)
}
},
Statistics: {
screen: StatisticsScreen,
navigationOptions: {
tabBarLabel: 'statistics',
tabBarIcon: ({}) => (
<Icon name = 'linechart' size = {28} color = 'gray' />
)
}
},
Messages: {
screen: MessagesScreen,
navigationOptions: {
tabBarLabel: 'messages',
tabBarIcon: ({}) => (
<Icon name = 'mail' size = {28} color = 'gray' />
)
}
}
})
);
export default class App extends React.Component {
componentDidMount() {
NfcManager.isSupported()
.then(result => {
console.log("Is it supported? " + result);
NfcManager.start()
.then(result => {
console.log("NFC started!");
})
.catch(err => {
console.log("Nope.", err);
});
NfcManager.isEnabled()
.then(result => {
console.log("NFC is enabled!", result);
})
.catch(err => {
console.log("Error in enabling NFC.", err);
});
});
}
componentWillUnmount() {
if (this._stateChangedSubscription) {
this._stateChangedSubscription.remove();
}
}
render() {
return(<AppContainer />);
}
}
const styles = StyleSheet.create({
navigatorContainer: {
backgroundColor: '#fff',
}
});