-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
54 lines (45 loc) · 1.38 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
import React, { useEffect, useState } from 'react'
import TestScreen from './screens/TestScreen'
import ControlScreen from './screens/ControlScreen'
import SplashScreen from './screens/SplashScreen'
import SearchScreen from './screens/SearchScreen'
import { DarkTheme, NavigationContainer, } from '@react-navigation/native'
import { TransitionPresets, createStackNavigator } from '@react-navigation/stack'
import store from './redux/store/store'
import { Provider } from 'react-redux'
const Stack = createStackNavigator()
const App = () => {
const [loading, setLoading] = useState(true);
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 3200);
return () => {
clearTimeout();
};
}, []);
return (
<Provider store={store}>
<NavigationContainer
theme={DarkTheme}
>
<Stack.Navigator
screenOptions={{
headerShown: false,
...TransitionPresets.SlideFromRightIOS,
}}>
{loading ? (
<Stack.Screen name="Splash" component={SplashScreen} />
) : (
<>
<Stack.Screen name="Test" component={TestScreen} />
<Stack.Screen name="Search" component={SearchScreen} />
<Stack.Screen name="Control" component={ControlScreen} />
</>
)}
</Stack.Navigator>
</NavigationContainer>
</Provider>
)
}
export default App