-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
86 lines (81 loc) · 2.41 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React, { useEffect } from "react";
import "./src/services/reactotron";
import { NavigationContainer } from "@react-navigation/native";
import RootNavigator from "./src/screens/root-navigator";
import { RecoilRoot } from "recoil";
import SplashScreen from "react-native-splash-screen";
import { PermissionsAndroid, Platform, View, Text } from "react-native";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import Toast from "react-native-toast-message";
import style from "./src/styles/card";
const toastConfig = {
custom: (props: any) => (
<>
{props.props.style == "success" && (
<View
style={{
width: "100%",
backgroundColor: "#37B235",
paddingHorizontal: 24,
paddingVertical: 6,
zIndex: 1000,
}}
>
<Text style={[style.AgH3, { color: "white" }]}>{props.text1}</Text>
<Text style={[style.AgP, { color: "white" }]}>{props.text2}</Text>
</View>
)}
{props.props.style == "error" && (
<View
style={{
width: "100%",
backgroundColor: "red",
paddingHorizontal: 24,
paddingVertical: 6,
zIndex: 1000,
}}
>
<Text style={[style.AgH3, { color: "white" }]}>{props.text1}</Text>
<Text style={[style.AgP, { color: "white" }]}>{props.text2}</Text>
</View>
)}
{props.props.style == "default" && (
<View
style={{
width: "100%",
backgroundColor: "#EAEAEA",
paddingHorizontal: 24,
paddingVertical: 6,
zIndex: 1000,
}}
>
<Text style={[style.AgH3, { color: "#9E9E9E" }]}>{props.text1}</Text>
<Text style={[style.AgP, { color: "#9E9E9E" }]}>{props.text2}</Text>
</View>
)}
</>
),
};
function App(): JSX.Element {
useEffect(() => {
SplashScreen.hide();
if (Platform.OS === "android") {
PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
);
}
}, []);
return (
<>
<GestureHandlerRootView style={{ flex: 1 }}>
<RecoilRoot>
<NavigationContainer>
<RootNavigator></RootNavigator>
</NavigationContainer>
</RecoilRoot>
</GestureHandlerRootView>
<Toast config={toastConfig} />
</>
);
}
export default App;