-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
59 lines (53 loc) · 1.54 KB
/
App.tsx
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
import "react-native-gesture-handler";
import React, { useEffect } from "react";
import { Keyboard, StatusBar } from "react-native";
import { NativeBaseProvider } from "native-base";
import { NavigationContainer, DefaultTheme } from "@react-navigation/native";
import { navigationRef } from "./src/routes/NavigationRef";
import { Provider as ReduxProvider } from "react-redux";
import AppMain from "./src/routes";
import store from "./src/store";
import AsyncStorage from "@react-native-async-storage/async-storage";
const App = () => {
useEffect(() => {
const keyboardDidShowListener = Keyboard.addListener(
"keyboardDidShow",
async () => {
await AsyncStorage.setItem("event", "keyboardDidShow");
}
);
const keyboardDidHideListener = Keyboard.addListener(
"keyboardDidHide",
async () => {
await AsyncStorage.setItem("event", "keyboardDidHide");
}
);
return () => {
keyboardDidShowListener.remove();
keyboardDidHideListener.remove();
};
}, []);
const MyTheme = {
...DefaultTheme,
DarkTheme: false,
colors: {
...DefaultTheme.colors,
text: "rgb(0, 0, 0)",
background: "rgb(232, 232, 232)",
border: "rgb(10, 10, 10)",
},
};
return (
<>
<StatusBar />
<NavigationContainer ref={navigationRef} theme={MyTheme}>
<NativeBaseProvider>
<ReduxProvider store={store}>
<AppMain />
</ReduxProvider>
</NativeBaseProvider>
</NavigationContainer>
</>
);
};
export default App;