-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
67 lines (64 loc) · 2.33 KB
/
App.tsx
File metadata and controls
67 lines (64 loc) · 2.33 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
55
56
57
58
59
60
61
62
63
64
65
66
67
import { CustomSchemaType } from '@eva-design/dss';
import * as eva from '@eva-design/eva';
import {
RobotoMono_400Regular,
useFonts,
} from '@expo-google-fonts/roboto-mono';
import { ApplicationProvider, IconRegistry } from '@ui-kitten/components';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import { StatusBar } from 'expo-status-bar';
import 'react-native-get-random-values';
import 'react-native-reanimated';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import theme from './assets/theme.json';
import mapping from './src/components/base/mapping.json';
import Navigation from './src/navigation';
import { persistor, store } from './src/redux/store';
import { useIsDark } from './src/utils/hooks';
import AlertProvider from './src/utils/providers/AlertProvider';
import PromptProvider from './src/utils/providers/PromptProvider';
import ToastProvider from './src/utils/providers/ToastProvider';
import * as SplashScreen from 'expo-splash-screen';
import { useEffect } from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
// @ts-expect-error partial mappings allowed
const customMapping = mapping as CustomSchemaType;
SplashScreen.preventAutoHideAsync();
export default function App() {
const isDark = useIsDark();
const [fontsLoaded] = useFonts({
RobotoMono_400Regular,
});
useEffect(() => {
if (fontsLoaded) {
SplashScreen.hideAsync();
}
}, [fontsLoaded]);
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<IconRegistry icons={EvaIconsPack} />
<StatusBar style={isDark ? 'light' : 'dark'} />
<ApplicationProvider
{...eva}
theme={{ ...(isDark ? eva.dark : eva.light), ...theme }}
customMapping={customMapping}
>
<SafeAreaProvider>
<GestureHandlerRootView style={{ flex: 1 }}>
<AlertProvider>
<PromptProvider>
<ToastProvider>
<Navigation />
</ToastProvider>
</PromptProvider>
</AlertProvider>
</GestureHandlerRootView>
</SafeAreaProvider>
</ApplicationProvider>
</PersistGate>
</Provider>
);
}