-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
54 lines (45 loc) · 1.7 KB
/
App.tsx
File metadata and controls
54 lines (45 loc) · 1.7 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
54
import { NavigationContainer } from '@react-navigation/native';
import { store } from '@store';
import { useFonts } from 'expo-font';
import * as SplashScreen from 'expo-splash-screen';
import React, { useCallback } from 'react';
import { LogBox } from 'react-native';
import { QueryClient, QueryClientProvider } from 'react-query';
import { Provider } from 'react-redux';
import CustomFlashMessage from 'src/components/common/CustomFlashMessage';
import { getPreferredLocale } from 'src/languages/localization';
import { RootNavigation } from 'src/navigation/RootNavigation';
const queryClient = new QueryClient();
SplashScreen.preventAutoHideAsync();
const App = () => {
LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
const [fontsLoaded] = useFonts({
'Manrope-Bold': require('src/assets/fonts/Manrope-Bold.ttf'),
'Manrope-ExtraBold': require('src/assets/fonts/Manrope-ExtraBold.ttf'),
'Manrope-Medium': require('src/assets/fonts/Manrope-Medium.ttf'),
'Manrope-Regular': require('src/assets/fonts/Manrope-Regular.ttf'),
'Manrope-SemiBold': require('src/assets/fonts/Manrope-SemiBold.ttf'),
});
const onLayoutRootView = useCallback(async () => {
// Language Local Setup
await getPreferredLocale();
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<QueryClientProvider client={queryClient}>
<Provider store={store}>
<NavigationContainer onReady={onLayoutRootView}>
<RootNavigation />
</NavigationContainer>
<CustomFlashMessage />
</Provider>
</QueryClientProvider>
);
};
export default App;
// const styles = StyleSheet.create({});