-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
84 lines (74 loc) · 2.69 KB
/
App.js
File metadata and controls
84 lines (74 loc) · 2.69 KB
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
import 'react-native-gesture-handler';
import React, {useEffect} from 'react';
import {YellowBox, Linking} from 'react-native';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import {persistor, store} from './store';
import {NavigationContainer} from '@react-navigation/native';
import {createDrawerNavigator} from '@react-navigation/drawer';
import {navigationRef, navigate} from './RootNavigation';
import DrawerContent from './components/DrawerContent';
import StackNavigator from './navigation/StackNavigator';
import DeepLinking from 'react-native-deep-linking';
import WalletConnectProvider from '@walletconnect/react-native-dapp';
import AsyncStorage from '@react-native-async-storage/async-storage';
const Drawer = createDrawerNavigator();
const App: () => React$Node = () => {
console.log(store.getState());
YellowBox.ignoreWarnings(['Setting a timer']);
// add URL schemes to `DeepLinking`
DeepLinking.addScheme('intootv://');
// configure a route, in this case, a simple Settings route
DeepLinking.addRoute('/walletconnect', (response) => {
console.log('Go To Wallet Connect');
console.log(response);
navigate('GuestHome');
});
// manage Linking event listener with useEffect
useEffect(() => {
Linking.addEventListener('url', handleOpenURL);
return () => {
Linking.removeEventListener('url', handleOpenURL);
};
}, []);
// evaluate every incoming URL
const handleOpenURL = (event) => {
DeepLinking.evaluateUrl(event.url);
};
Linking.getInitialURL()
.then((url) => {
if (url) {
Linking.openURL(url);
}
})
.catch((err) => console.error('An error occurred', err));
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<WalletConnectProvider
// uri="intootv://"
bridge="https://bridge.walletconnect.org"
clientMeta={{
description: 'Connect with WalletConnect',
url: 'https://walletconnect.org',
icons: ['https://walletconnect.org/walletconnect-logo.png'],
name: 'Intoo TV',
}}
redirectUrl="intootv://"
storageOptions={{
asyncStorage: AsyncStorage,
}}>
<NavigationContainer ref={navigationRef}>
<Drawer.Navigator
drawerPosition="left"
drawerType="front"
drawerContent={(props) => <DrawerContent {...props} />}>
<Drawer.Screen name="Home" component={StackNavigator} />
</Drawer.Navigator>
</NavigationContainer>
</WalletConnectProvider>
</PersistGate>
</Provider>
);
};
export default App;