-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathApp.js
49 lines (44 loc) · 1.8 KB
/
App.js
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
import Clipboard from '@react-native-clipboard/clipboard';
import {WalletConnectModal} from '@walletconnect/modal-react-native';
import '@walletconnect/react-native-compat';
import React from 'react';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import WebviewCrypto from 'react-native-webview-crypto';
import {Provider} from 'react-redux';
import {persistStore} from 'redux-persist';
import {PersistGate} from 'redux-persist/integration/react';
import VideoCallContextProvider from 'src/contexts/VideoContext';
import AppScreens from 'src/navigation';
import {useNotification} from 'src/push_video/hooks/useNotification';
import store from 'src/redux';
import {WalletConnectConfig} from 'src/walletconnect';
import appConfig from './app.json';
let persistor = persistStore(store);
const App = ({isCallAccepted}) => {
const {numBgCallAccepted} = useNotification();
return (
<SafeAreaProvider>
<GestureHandlerRootView style={{flex: 1}}>
<WebviewCrypto />
<WalletConnectModal
projectId={WalletConnectConfig.projectId}
providerMetadata={WalletConnectConfig.providerMetadata(
`${appConfig.expo.scheme}://`,
)}
sessionParams={WalletConnectConfig.sessionParams}
relayUrl="wss://relay.walletconnect.com"
onCopyClipboard={value => Clipboard.setString(value)}
/>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<VideoCallContextProvider>
<AppScreens callAccepted={numBgCallAccepted || isCallAccepted} />
</VideoCallContextProvider>
</PersistGate>
</Provider>
</GestureHandlerRootView>
</SafeAreaProvider>
);
};
export default App;