This repository was archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathApp.tsx
78 lines (72 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
70
71
72
73
74
75
76
77
78
import {
ConnectWallet,
embeddedWallet,
localWallet,
metamaskWallet,
rainbowWallet,
ThirdwebProvider,
trustWallet,
walletConnect,
} from '@thirdweb-dev/react-native';
import React from 'react';
import {StyleSheet, Text, useColorScheme, View} from 'react-native';
import {Colors} from 'react-native/Libraries/NewAppScreen';
import {TW_CLIENT_ID} from '@env';
const App = () => {
return (
<ThirdwebProvider
activeChain="mumbai"
clientId={TW_CLIENT_ID}
supportedWallets={[
metamaskWallet({
recommended: true,
}),
rainbowWallet(),
walletConnect({
recommended: true,
}),
embeddedWallet({
auth: {
// you need to enable EmbeddedWallets under your API Key in your thirdweb dashboard:
// https://thirdweb.com/dashboard/settings/api-keys
options: ['email', 'google'],
// you need to add this deeplink in your allowed `Redirect URIs` under your API Key in your thirdweb dashboard:
// https://thirdweb.com/dashboard/settings/api-keys
redirectUrl: 'rnstarter://',
},
}),
trustWallet(),
localWallet(),
]}>
<AppInner />
</ThirdwebProvider>
);
};
const AppInner = () => {
const isDarkMode = useColorScheme() === 'dark';
const textStyles = {
color: isDarkMode ? Colors.white : Colors.black,
...styles.heading,
};
return (
<View style={styles.view}>
<Text style={textStyles}>React Native thirdweb starter</Text>
<ConnectWallet />
</View>
);
};
const styles = StyleSheet.create({
view: {
height: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
alignContent: 'center',
},
heading: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 20,
},
});
export default App;