-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
41 lines (38 loc) · 1.2 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
import React from 'react';
import { View, StatusBar } from 'react-native';
import { Constants } from 'expo'
import Screens from './application/screens'
import { statusColor } from './application/config/colors'
import { Provider } from 'mobx-react'
import Store from './application/store'
import { setLocalNotification } from './application/api'
//onAction and onSnapshot are used for debugging. Unable that for production
import { onAction, onSnapshot } from "mobx-state-tree";
onAction(Store, action => {
console.log('Action called : ', action);
});
onSnapshot(Store, newSnapshot => {
console.log("New state: ", newSnapshot)
})
function CustomStatusBar({ backgroundColor, ...props }) {
return (
<View style={{ backgroundColor, height: Constants.statusBarHeight }}>
<StatusBar translucent backgroundColor={backgroundColor} {...props} />
</View>
)
}
export default class App extends React.Component {
componentDidMount() {
setLocalNotification()
}
render() {
return (
<Provider store={Store}>
<View style={{ flex: 1 }}>
<CustomStatusBar backgroundColor={statusColor} barStyle="light-content" />
<Screens />
</View>
</Provider>
);
}
}