-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
40 lines (39 loc) · 1.17 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
import { useColorScheme } from "react-native";
import AppNavigator from "./AppNavigator";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import { persistor, store } from "./src/redux/store";
import { MenuProvider } from "react-native-popup-menu";
import {
Provider as PaperProvider,
MD3LightTheme,
MD3DarkTheme,
} from "react-native-paper";
import { lightScheme } from "./src/theme/lightScheme";
import { DarkScheme } from "./src/theme/darkScheme";
import * as SplashScreen from "expo-splash-screen";
const LightTheme = {
...MD3LightTheme,
colors: lightScheme,
};
const DarkTheme = {
...MD3DarkTheme,
colors: DarkScheme,
};
SplashScreen.preventAutoHideAsync();
setTimeout(SplashScreen.hideAsync, 3000);
export default function App() {
const colorscheme = useColorScheme();
const theme = colorscheme === "dark" ? DarkTheme : LightTheme;
return (
<MenuProvider>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<PaperProvider theme={theme}>
<AppNavigator />
</PaperProvider>
</PersistGate>
</Provider>
</MenuProvider>
);
}