-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
38 lines (35 loc) · 1.06 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
35
36
37
38
import React, {useEffect, useState} from 'react';
import LoginNavigator from './src/pages/Login/LoginNavigator';
import {NavigationContainer} from '@react-navigation/native';
import {Provider} from 'react-redux';
import store from './src/app/store';
import {defaultAxios} from './src/api';
import SplashScreen from 'react-native-splash-screen';
import {SafeAreaView} from 'react-native';
import LoginMainImage from './src/assets/LoginMainImage.svg';
const App = () => {
useEffect(() => {
defaultAxios();
}, []);
const [isAppLoading, setIsAppLoading] = useState<boolean>(true);
useEffect(() => {
setTimeout(() => {
console.log('After Splashed 3seconds');
setIsAppLoading(false);
SplashScreen.hide();
}, 3000);
}, []);
return isAppLoading ? (
<SafeAreaView
style={{flex: 1, backgroundColor: '#FEFCF3', alignItems: 'center'}}>
<LoginMainImage />
</SafeAreaView>
) : (
<Provider store={store}>
<NavigationContainer>
<LoginNavigator />
</NavigationContainer>
</Provider>
);
};
export default App;