-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
104 lines (96 loc) · 2.99 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
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
import "react-native-gesture-handler"; // Must be listed first
import "setimmediate";
import {
TRenderEngineProvider,
RenderHTMLConfigProvider,
} from "react-native-render-html";
import { extendTheme, NativeBaseProvider, Text } from "native-base";
import { SafeAreaProvider } from "react-native-safe-area-context";
import {
NavigationContainer,
createNavigationContainerRef,
} from "@react-navigation/native";
import { ActionSheetProvider } from "@expo/react-native-action-sheet";
import * as Linking from "expo-linking";
import { AuthProvider } from "./contexts/useAuth";
import ContextWrapper from "./contexts/ContextWrapper";
import Routing from "./utilities/Routing";
import * as Sentry from "sentry-expo";
// Sentry Reporting
// Construct a new instrumentation instance. This is needed to communicate between the integration and React
const routingInstrumentation =
new Sentry.Native.ReactNavigationInstrumentation();
Sentry.init({
dsn: "https://[email protected]/5204912",
enableInExpoDevelopment: false,
debug: __DEV__, //logs all sentry info, which is a lot with touch events
environment: __DEV__ ? "Development" : "Production",
integrations: [
new Sentry.Native.ReactNativeTracing({
routingInstrumentation,
}),
],
});
const theme = extendTheme({
colors: {
primary: "#F77E9D",
secondary: "#3DC2FF",
tertiary: "#6A64FF",
success: "#2DD36F",
warning: "#FFC409",
error: "#EB445A",
},
components: {
Container: {
defaultProps: {
maxW: "100%",
},
},
Pressable: {
defaultProps: {
maxW: "100%",
},
},
},
});
function App() {
// Create a ref for the navigation container
const navigationRef = createNavigationContainerRef();
//Deep Linking
const prefix = Linking.createURL("/");
const linking = {
prefixes: [prefix],
};
return (
<Sentry.Native.TouchEventBoundary>
<TRenderEngineProvider>
<RenderHTMLConfigProvider>
<SafeAreaProvider>
<NativeBaseProvider theme={theme}>
<ActionSheetProvider>
<AuthProvider>
{/* Our Authentication, which Navigation depends on */}
<NavigationContainer
linking={linking}
fallback={<Text>Loading...</Text>}
ref={navigationRef}
onReady={() => {
routingInstrumentation.registerNavigationContainer(
navigationRef,
);
}}
>
<ContextWrapper>
<Routing />
</ContextWrapper>
</NavigationContainer>
</AuthProvider>
</ActionSheetProvider>
</NativeBaseProvider>
</SafeAreaProvider>
</RenderHTMLConfigProvider>
</TRenderEngineProvider>
</Sentry.Native.TouchEventBoundary>
);
}
export default Sentry.Native.wrap(App);