-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
App.tsx
82 lines (75 loc) · 2.4 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
import "react-native-gesture-handler"
// https://github.com/facebook/react-native/issues/23922
import "react-native-url-polyfill/auto"
import React from "react"
import { ThemeProvider } from "styled-components"
import { ThemeProvider as NativeThemeProvider } from "styled-components/native"
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context"
import * as Sentry from "sentry-expo"
import { CaptureConsole } from "@sentry/integrations"
import { theme } from "@ory/themes"
import {
useFonts as useFontsRoboto,
Roboto_400Regular,
} from "@expo-google-fonts/roboto"
import {
useFonts as useFontsRubik,
Rubik_300Light,
Rubik_400Regular,
Rubik_500Medium,
} from "@expo-google-fonts/rubik"
import Navigation from "./src/components/Navigation"
import ErrorBoundary from "./src/components/ErrorBoundary"
import AuthProvider from "./src/components/AuthProvider"
import ForkMe from "./src/components/Styled/ForkMe"
import ProjectProvider from "./src/components/ProjectProvider"
Sentry.init({
dsn: "https://[email protected]/5530799",
enableInExpoDevelopment: true,
debug: false,
integrations: [
new CaptureConsole({
levels: ["error", "warn", "log"],
}),
],
})
export default function App() {
const [robotoLoaded] = useFontsRoboto({ Roboto_400Regular })
const [rubikLoaded] = useFontsRubik({
Rubik_300Light,
Rubik_400Regular,
Rubik_500Medium,
})
const hydratedTheme = {
...theme,
regularFont300: rubikLoaded ? "Rubik_300Light" : "Arial",
regularFont400: rubikLoaded ? "Rubik_400Regular" : "Arial",
regularFont500: rubikLoaded ? "Rubik_500Medium" : "Arial",
codeFont400: robotoLoaded ? "Roboto_400Regular" : "Arial",
platform: "react-native",
}
return (
<ThemeProvider theme={hydratedTheme}>
<NativeThemeProvider theme={hydratedTheme}>
<SafeAreaProvider>
<SafeAreaView
edges={["top", "left", "right"]}
style={{
flex: 1,
backgroundColor: theme.grey5,
}}
>
<ProjectProvider>
<AuthProvider>
<ErrorBoundary>
<Navigation />
<ForkMe />
</ErrorBoundary>
</AuthProvider>
</ProjectProvider>
</SafeAreaView>
</SafeAreaProvider>
</NativeThemeProvider>
</ThemeProvider>
)
}