/
App.tsx
51 lines (48 loc) · 1.17 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
import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, View, useColorScheme } from "react-native";
import {
DarkTheme,
DefaultTheme,
NavigationContainer,
Theme,
} from "@react-navigation/native";
import RootNavigator from "./src/navigators/RootNavigator";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { useMemo } from "react";
export default function App() {
// Let's add dark mode
const colorScheme = useColorScheme();
const theme: Theme = useMemo(
() =>
colorScheme === "dark"
? {
...DarkTheme,
colors: {
...DarkTheme.colors,
primary: "#fff",
},
}
: {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: "#000",
},
},
[colorScheme]
);
// Not Working
return (
<SafeAreaProvider style={styles.container}>
<NavigationContainer theme={theme}>
<RootNavigator />
</NavigationContainer>
<StatusBar style="auto" />
</SafeAreaProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});