-
Notifications
You must be signed in to change notification settings - Fork 14
/
App.tsx
34 lines (30 loc) · 1.02 KB
/
App.tsx
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
import React, {useEffect, useState} from 'react';
import 'react-native-gesture-handler';
import CustomContainer from './src/components/navigatior/custom-container';
import Orientation from 'react-native-orientation-locker';
import {StatusBar, View} from 'react-native';
import {TOMATOX_THEME} from './src/utils/theme';
import initStorage from './src/utils/storage/storage';
import {querySearchIndex} from './src/utils/request';
Orientation.lockToPortrait();
const App = () => {
const [isInit, setIsInit] = useState(false);
useEffect(() => {
querySearchIndex();
initStorage().then(() => {
setIsInit(true);
});
}, []);
return isInit ?
<View style={{ flex:1, backgroundColor: TOMATOX_THEME.BACKGROUND_COLOR }}>
<StatusBar
backgroundColor={TOMATOX_THEME.BACKGROUND_COLOR}
barStyle={'light-content'}
/>
<View style={{flex: 1}}>
<CustomContainer />
</View>
</View> :
<></>;
};
export default App;