-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
43 lines (38 loc) · 1.33 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React, { useState } from "react";
import type { Node } from "react";
import { persistStore } from "redux-persist";
import { Provider } from "react-redux";
import { store } from "./data/store";
import { PersistGate } from "redux-persist/integration/react";
import MainScreen from "./screens/MainScreen";
import { NavigationContainer,
DefaultTheme,
DarkTheme, } from "@react-navigation/native";
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import SettingsScreen from "./screens/SettingsScreen";
import { useColorScheme } from 'react-native';
const persistor = persistStore(store);
const Stack = createNativeStackNavigator();
const App: () => Node = () => {
const scheme = useColorScheme();
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<NavigationContainer theme={scheme === 'dark' ? DarkTheme : DefaultTheme}>
<Stack.Navigator>
<Stack.Screen name="Home" component={MainScreen} options={{headerShown: false}}/>
<Stack.Screen name="Settings" component={SettingsScreen} />
</Stack.Navigator>
</NavigationContainer>
</PersistGate>
</Provider>
);
};
export default App;