This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
App.js
106 lines (98 loc) · 2.84 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import React from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { NavigationContainer } from "@react-navigation/native";
import TabScreen from "./src/screens/TabScreen";
import WatchScreen from "./src/screens/WatchScreen";
import SelectScreen from "./src/screens/SelectScreen";
import GeneralSettingsScreen from "./src/screens/GeneralSettingsScreen";
import AboutScreen from "./src/screens/AboutScreen";
import LoadingScreen from "./src/screens/LoadingScreen";
import { Storage } from "./src/components/Storage";
import WeCimaExtractionScreen from "./src/screens/WeCimaExtractionScreen";
import { getPaletteSync } from "@assembless/react-native-material-you";
import {
Provider as PaperProvider,
useTheme,
MD3DarkTheme as DefaultTheme,
} from "react-native-paper";
const Stack = createNativeStackNavigator();
const MyStack = () => {
const theme = useTheme();
return (
<Stack.Navigator
initialRouteName={"Tab"}
screenOptions={{
statusBarColor: theme.dark ? "black" : "white",
statusBarStyle: theme.dark ? "light" : "dark",
headerStyle: { backgroundColor: theme.colors.background },
headerTintColor: theme.dark ? "white" : "black",
headerShadowVisible: false,
contentStyle: { backgroundColor: theme.colors.background },
}}>
<Stack.Screen
name="Tab"
component={TabScreen}
options={{
headerShown: false,
}}
/>
<Stack.Screen
name="Watch"
component={WatchScreen}
options={{
headerShown: false,
orientation: "all",
statusBarHidden: true,
navigationBarHidden: true,
}}
/>
<Stack.Screen
name="Select"
component={SelectScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Loading"
component={LoadingScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="WeCima Extraction"
component={WeCimaExtractionScreen}
options={{ headerShown: false, animation: "none" }}
/>
<Stack.Screen name="General Settings" component={GeneralSettingsScreen} />
<Stack.Screen name="About" component={AboutScreen} />
</Stack.Navigator>
);
};
const App = () => {
if (!Storage.contains("pureBlack")) {
Storage.set("pureBlack", true);
} else {
// pass
}
const palette = getPaletteSync();
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: palette.system_accent1[5],
background: Storage.getBoolean("pureBlack")
? "black"
: "rgba(28, 27, 31, 1)",
elevation: {
level4: palette.system_accent1[4] + "3C",
},
secondaryContainer: palette.system_accent1[4] + "3C",
},
};
return (
<PaperProvider theme={theme}>
<NavigationContainer>
<MyStack />
</NavigationContainer>
</PaperProvider>
);
};
export default App;