-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
69 lines (60 loc) · 1.85 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
import { NavigationContainer } from "@react-navigation/native"
import React, { useEffect } from "react"
import * as SplashScreen from "expo-splash-screen"
import MainStackNavigator from "./navigation/Main/MainStackNavigator"
import { GestureHandlerRootView } from "react-native-gesture-handler"
import styles from "./styles"
import {
useFonts,
JetBrainsMono_100Thin_Italic,
JetBrainsMono_400Regular,
JetBrainsMono_700Bold,
} from "@expo-google-fonts/jetbrains-mono"
import { SafeAreaProvider } from "react-native-safe-area-context"
import { StatusBar } from "expo-status-bar"
import * as WebBrowser from "expo-web-browser"
import * as Linking from "expo-linking"
// import HomeScreen from "./screens/Home/HomeScreen"
// Call the function to destroy the graph file when the app launches
destroyGraphFileIfExists()
import Toast from "react-native-toast-message"
import { destroyGraphFileIfExists } from "./components/Graph/GraphFileFunctions"
SplashScreen.preventAutoHideAsync()
WebBrowser.maybeCompleteAuthSession()
export default function App() {
const linking = {
prefixes: [Linking.createURL("/")],
config: {
screens: {
ExternalProfile: "contact/:uid",
},
},
}
const [fontsLoaded] = useFonts({
JetBrainsMono_100Thin_Italic,
JetBrainsMono_400Regular,
JetBrainsMono_700Bold,
})
useEffect(() => {
async function hideSplashScreen() {
if (fontsLoaded) {
await SplashScreen.hideAsync()
}
}
hideSplashScreen()
}, [fontsLoaded])
if (!fontsLoaded) {
return null
}
return (
<GestureHandlerRootView style={styles.gestureHandler}>
<StatusBar style="dark" />
<SafeAreaProvider>
<NavigationContainer linking={linking}>
<MainStackNavigator />
</NavigationContainer>
<Toast />
</SafeAreaProvider>
</GestureHandlerRootView>
)
}