-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
60 lines (52 loc) · 1.73 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
55
56
57
58
59
60
import React, { useCallback } from 'react';
import { Platform, StatusBar } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { useFonts } from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import { Provider } from 'react-redux';
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { delay } from './helpers/delay';
// import 'expo-dev-client';
//new test line
import Main from './Main';
import { store } from './redux/store';
SplashScreen.preventAutoHideAsync();
export default function App() {
const [fontsLoaded] = useFonts({
'Roboto-Regular': require('./assets/fonts/roboto/Roboto-Regular.ttf'),
'Roboto-Bold': require('./assets/fonts/roboto/Roboto-Bold.ttf'),
});
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await delay(
() =>
StatusBar.pushStackEntry({
barStyle: 'dark-content',
translucent: true,
animated: true,
backgroundColor: 'transparent',
}),
2000
);
delay(SplashScreen.hideAsync, 33);
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<Provider store={store}>
<GestureHandlerRootView style={{ flex: 1 }}>
<BottomSheetModalProvider>
<ActionSheetProvider>
<NavigationContainer headerMode="none">
<Main hideSplashScreen={onLayoutRootView} />
</NavigationContainer>
</ActionSheetProvider>
</BottomSheetModalProvider>
</GestureHandlerRootView>
</Provider>
);
}