-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.tsx
52 lines (46 loc) · 1.76 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
// In App.js in a new project
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import "react-native-gesture-handler";
import React from "react";
import { View } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import ClientContextProvider from "./components/ClientContext";
import ErrorContextProvider, { ErrorMessage } from "./components/ErrorContext";
import SettingsContextProvider from "./components/SettingsContext";
import ConnectTabs from "./screens/ConnectTabs";
import Connected from "./screens/Connected";
import { StatusBar } from "expo-status-bar";
import structuredClone from "@ungap/structured-clone";
require("react-native-get-random-values");
if (!("structuredClone" in globalThis)) {
globalThis.structuredClone = structuredClone;
}
const Stack = createNativeStackNavigator();
const EmptyHeader = () => <></>;
function App() {
return (
<SafeAreaProvider>
<ErrorContextProvider>
<ClientContextProvider>
<SettingsContextProvider>
<View style={{ flex: 15 }}>
<StatusBar style="dark" />
<NavigationContainer>
<Stack.Navigator
initialRouteName="connect"
screenOptions={{ header: EmptyHeader }}
>
<Stack.Screen name="connect" component={ConnectTabs} />
<Stack.Screen name="connected" component={Connected} />
</Stack.Navigator>
</NavigationContainer>
</View>
<ErrorMessage />
</SettingsContextProvider>
</ClientContextProvider>
</ErrorContextProvider>
</SafeAreaProvider>
);
}
export default App;