-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
54 lines (47 loc) · 1.74 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
import "react-native-url-polyfill/auto";
import "event-target-polyfill";
import "fast-text-encoding";
import React from "react";
import {StatusBar, useColorScheme} from "react-native";
import FlashMessage from "react-native-flash-message";
import {GestureHandlerRootView} from "react-native-gesture-handler";
import {btoa, atob} from "react-native-quick-base64";
// import "react-native/tvos-types.d";
import {SafeAreaProvider} from "react-native-safe-area-context";
import AccountContextProvider from "./src/context/AccountContext";
import AppDataContextProvider from "./src/context/AppDataContext";
import AppStyleProvider from "./src/context/AppStyleContext";
import YoutubeContextProvider from "./src/context/YoutubeContext";
import Navigation from "./src/navigation/Navigation";
import BackgroundWrapper from "./src/utils/BackgroundWrapper";
// Polyfill for youtube.js
Object.assign(global, {
btoa,
atob,
});
const App = () => {
const isDarkMode = useColorScheme() === "dark";
return (
<GestureHandlerRootView style={{flex: 1}}>
<AppStyleProvider>
<BackgroundWrapper>
<AppDataContextProvider>
<YoutubeContextProvider>
<AccountContextProvider>
<StatusBar
// TODO: Currently only dark-mode exists
barStyle={isDarkMode ? "light-content" : "light-content"}
/>
<SafeAreaProvider>
<Navigation />
<FlashMessage position={"top"} />
</SafeAreaProvider>
</AccountContextProvider>
</YoutubeContextProvider>
</AppDataContextProvider>
</BackgroundWrapper>
</AppStyleProvider>
</GestureHandlerRootView>
);
};
export default App;