-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
53 lines (47 loc) · 1.44 KB
/
Copy pathApp.js
File metadata and controls
53 lines (47 loc) · 1.44 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
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import HomeScreen from './screens/HomeScreen';
import { useFonts, Inter_500Medium } from '@expo-google-fonts/inter';
import { useEffect, useCallback } from 'react';
import Toast from 'react-native-toast-message';
import ShareScreen from './screens/ShareScreen';
import { Provider } from 'react-redux';
import store from './store';
import * as SplashScreen from 'expo-splash-screen';
const Stack = createNativeStackNavigator();
SplashScreen.preventAutoHideAsync();
export default function App() {
let [fontsLoaded] = useFonts({
Inter_500Medium
});
useEffect(() => {
async function prepare() {
await SplashScreen.preventAutoHideAsync();
}
prepare();
}, []);
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<Provider store={store}>
<NavigationContainer onReady={onLayoutRootView}>
<Stack.Navigator
initialRouteName="HomeScreen"
screenOptions={{
headerShown: false
}}
>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Share" component={ShareScreen} />
</Stack.Navigator>
</NavigationContainer>
<Toast />
</Provider>
);
}