-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
56 lines (51 loc) · 1.61 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
import "./global";
import { Platform, View, Text, StyleSheet } from "react-native";
import WalletConnectProvider from "@walletconnect/react-native-dapp";
import AsyncStorage from "@react-native-async-storage/async-storage";
import Landing from "./components/Landing";
import { useFonts } from "expo-font";
import * as SplashScreen from "expo-splash-screen";
import { useEffect, useCallback } from "react";
export default function App() {
const [fontsLoaded] = useFonts({
"DMMono-Italic": require("./assets/fonts/DMMono-Italic.ttf"),
"DMMono-Light": require("./assets/fonts/DMMono-Light.ttf"),
"DMMono-LightItalic": require("./assets/fonts/DMMono-LightItalic.ttf"),
"DMMono-Medium": require("./assets/fonts/DMMono-Medium.ttf"),
"DMMono-MediumItalic": require("./assets/fonts/DMMono-MediumItalic.ttf"),
"DMMono-Regular": require("./assets/fonts/DMMono-Regular.ttf"),
});
useEffect(() => {
async function prepare() {
await SplashScreen.preventAutoHideAsync();
}
prepare();
}, []);
const onLayoutRootView = useCallback(async () => {
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<WalletConnectProvider
redirectUrl={
Platform.OS === "web" ? window.location.origin : "yourappscheme://"
}
storageOptions={{
asyncStorage: AsyncStorage as any,
}}
>
<View style={styles.container} onLayout={onLayoutRootView}>
<Landing />
</View>
</WalletConnectProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});