-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
64 lines (57 loc) · 1.94 KB
/
index.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'react-native-gesture-handler';
import React, { useMemo } from 'react';
import { AppRegistry, LogBox } from 'react-native';
import { Provider } from 'react-redux';
import 'react-native-get-random-values';
import '@ethersproject/shims';
import App from './src/App';
import { name as appName } from './app.json';
import { realmContext } from '~Storage/Realm';
import { store } from '~Storage/Redux';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { useColorScheme, useTheme } from '~Utils';
const { RealmProvider } = realmContext;
import { ethers } from 'ethers';
export const ethersProvider = new ethers.providers.JsonRpcProvider(
'https://polygon-mainnet.g.alchemy.com/v2/c2UXl9xyDGsmFW8yLal1KpwNsU5kgrrz',
);
export class WalletGlobal {
constructor(_wallet) {
if (WalletGlobal._instance) {
return WalletGlobal._instance;
}
WalletGlobal._instance = this;
this.wallet = _wallet;
}
}
LogBox.ignoreLogs(['The native module for Flipper', 'ViewPropTypes']);
const getTheme = (scheme, colorTheme) => {
const theme = {
colors: {
background: scheme === 'dark' ? colorTheme.dark : colorTheme.light,
border: scheme === 'dark' ? colorTheme.dark : colorTheme.light,
},
};
return theme;
};
const Main = () => {
const scheme = useColorScheme();
const theme = useTheme();
const colorScheme = useMemo(
() => getTheme(scheme, theme.constants),
[scheme, theme],
);
return (
<Provider store={store}>
<NavigationContainer theme={colorScheme}>
<RealmProvider>
<SafeAreaProvider>
<App />
</SafeAreaProvider>
</RealmProvider>
</NavigationContainer>
</Provider>
);
};
AppRegistry.registerComponent(appName, () => Main);