-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
54 lines (50 loc) · 1.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {Platform, StatusBar, UIManager} from 'react-native';
import Route from '@/Route';
import '@/config';
import StoreProvider from '@/mst/StoreProvider';
import DropdownAlert from '@/components/DropDownAlert';
import DebugConfig from '@/config/DebugConfig';
import {ActionSheetProvider} from '@expo/react-native-action-sheet';
import Hud from '@/components/hud';
import * as TaskManager from 'expo-task-manager';
import AppConfig from '@/config/AppConfig';
import {processLocationUpdate} from "@/utils/location";
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
// Define background task to update the location`
TaskManager.defineTask(AppConfig.locationTaskName, async ({data, error}) => {
if (error) {
return;
}
if (data) {
const {locations} = data;
await processLocationUpdate(locations);
}
});
const App = () => {
return (
<>
<StatusBar barStyle={'dark-content'} />
<ActionSheetProvider>
<StoreProvider>
<Route />
<DropdownAlert />
<Hud />
</StoreProvider>
</ActionSheetProvider>
</>
);
};
// allow reactotron overlay for fast design in dev mode
export default DebugConfig.useReactotron ? console.tron.overlay(App) : App;