-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
76 lines (68 loc) · 2.42 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
import React from "react";
import { AppDetail, Main, Settings } from "./screens";
import { NavigationContainer } from "@react-navigation/native";
import { useColorScheme, LogBox } from 'react-native';
import { RootSiblingParent } from 'react-native-root-siblings';
import { MD3LightTheme, MD3DarkTheme, Provider as PaperProvider } from 'react-native-paper';
import { DefaultTheme, DarkTheme } from '@react-navigation/native';
import { StatusBar } from 'expo-status-bar';
import { ThemeProp } from "react-native-paper/lib/typescript/types";
import { createStackNavigator } from "@react-navigation/stack";
import * as Global from "./Global";
import * as Notifications from 'expo-notifications';
export default function App() {
const Stack = createStackNavigator();
LogBox.ignoreAllLogs();
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,
shouldSetBadge: false,
}),
});
const isDarkTheme = useColorScheme() == 'dark';
const theme: ThemeProp = {
...isDarkTheme ? MD3DarkTheme : MD3LightTheme,
dark: isDarkTheme,
roundness: 2,
version: 3,
colors: {
...isDarkTheme ? MD3DarkTheme.colors : MD3LightTheme.colors,
primary: '#2196f3', //'#EC407A',
secondary: '#9c27b0', //'#28C4ED',
background: isDarkTheme ? '#121212' : "#FFFFFF"
},
};
const themeNavigation = {
...isDarkTheme ? DarkTheme : DefaultTheme,
colors: {
...isDarkTheme ? DarkTheme.colors : DefaultTheme.colors,
},
};
return (
<PaperProvider theme={theme}>
<StatusBar style={isDarkTheme ? "light" : "dark"} />
<RootSiblingParent>
<NavigationContainer theme={themeNavigation} ref={Global.navigationRef}>
<Stack.Navigator>
<Stack.Screen
name="Main"
options={{ headerShown: false, animationEnabled: false }}
component={Main}
></Stack.Screen>
<Stack.Screen
name="Settings"
options={{ headerShown: true, animationEnabled: false }}
component={Settings}
></Stack.Screen>
<Stack.Screen
name="AppDetail"
options={{ headerShown: false, animationEnabled: false }}
component={AppDetail}
></Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
</RootSiblingParent>
</PaperProvider>
);
}