-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
52 lines (44 loc) · 1.46 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
import { LogBox, SafeAreaView, StatusBar } from "react-native";
import {
Provider as PaperProvider,
useTheme,
MD3Colors,
} from "react-native-paper";
import { useFonts } from "expo-font";
import { MyGlobalContext } from "./context/MyGlobalContext";
// 👇 theme
import { theme } from "./theme/theme";
// 👇 styles
import { appStyles } from "./styles/App.styles";
// 👇 components
import Navigator from "./navigation/Navigator";
import { useEffect } from "react";
export type GlobalContext = {
fontLoaded: boolean;
};
export default function App() {
const [caveat_fontLoaded] = useFonts({
caveat: require("./assets/fonts/caveat/Caveat-Regular.ttf"),
caveat_bold: require("./assets/fonts/caveat/Caveat-Bold.ttf"),
caveat_medium: require("./assets/fonts/caveat/Caveat-Medium.ttf"),
caveat_semiBold: require("./assets/fonts/caveat/Caveat-SemiBold.ttf"),
});
// 👇 configure the theme
const temp_theme = useTheme();
temp_theme.colors.primary = theme.colors.primary;
temp_theme.colors.secondary = theme.colors.secondary;
temp_theme.colors.secondaryContainer = "transparent";
useEffect(() => {
LogBox.ignoreAllLogs(true);
}, []);
return (
<MyGlobalContext.Provider value={{ caveat_fontLoaded }}>
<PaperProvider theme={theme}>
<SafeAreaView style={appStyles.container}>
<StatusBar barStyle="default" />
<Navigator />
</SafeAreaView>
</PaperProvider>
</MyGlobalContext.Provider>
);
}