Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
Latest commit
58 lines (52 loc) · 1.7 KB
/
Copy pathApp.js
File metadata and controls
58 lines (52 loc) · 1.7 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
importReact,{useState,useMemo,createContext,useEffect}from'react';
import{StyleSheet,StatusBar}from'react-native';
import{Colors}from'react-native/Libraries/NewAppScreen';
importBottomTabfrom'./src/components/common/bottomTab';
import{GetToken}from'./src/utils/controlToken';
import{NativeBaseProvider}from'native-base';
import{SafeAreaProvider}from'react-native-safe-area-context';
importaxiosfrom'axios';
importHome_Testfrom'./src/screens/pay_test/homeTest';
importIamportNavigationfrom'./src/navigation/pay_test/pay_test';
importCheckFirstLaunchfrom'./src/utils/checkFirstLaunch';
// axios.defaults.baseURL = 'http://10.0.2.2:5000';
axios.defaults.baseURL='http://35.197.107.190:5000';
exportconstRefreshContext=createContext({
refresh: false,
setRefresh: ()=>{},
});
constApp=()=>{
const[refresh,setRefresh]=useState();
const[isFirst,setIsFirst]=useState(false);
constvalue=useMemo(()=>({refresh, setRefresh}),[refresh,setRefresh]);
constmainR=async()=>{
awaitGetToken().then(r=>setRefresh(r));
awaitCheckFirstLaunch().then(r=>setIsFirst(r));
};
useEffect(()=>{
mainR();
},[]);
return(
<>
{/* <StatusBar barStyle="dark-content" />
<MapView
appKey="l7xx9d4d587fe7104a57b8feda886c846d1f"
style={styles.map}
lat={48.577741}
lng={27.602706}
/> */}
<RefreshContext.Providervalue={value}>
<NativeBaseProvider>
<BottomTabisFirst={isFirst}/>
</NativeBaseProvider>
</RefreshContext.Provider>
</>
);
};
conststyles=StyleSheet.create({
map: {
flex: 1,
backgroundColor: Colors.lighter,
},
});
exportdefaultApp;