@sudobility/web3-components-rn 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddressLabel.d.ts.map +1 -1
- package/dist/WalletIcon.d.ts.map +1 -1
- package/dist/index.cjs.js +36 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +36 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +5 -4
- package/src/AddressLabel.tsx +5 -9
- package/src/CryptoPortfolio.tsx +3 -3
- package/src/GasTracker.tsx +3 -3
- package/src/NftGallery.tsx +3 -3
- package/src/TokenSwap.tsx +3 -3
- package/src/WalletConnect.tsx +3 -3
- package/src/WalletIcon.tsx +40 -9
- package/src/WalletSelection.tsx +17 -17
- package/src/index.ts +5 -1
package/src/WalletConnect.tsx
CHANGED
|
@@ -23,8 +23,8 @@ export const WalletConnect: React.FC<WalletConnectProps> = ({
|
|
|
23
23
|
<Pressable
|
|
24
24
|
onPress={disabled ? undefined : onPress}
|
|
25
25
|
disabled={disabled}
|
|
26
|
-
accessibilityRole=
|
|
27
|
-
accessibilityLabel=
|
|
26
|
+
accessibilityRole='button'
|
|
27
|
+
accessibilityLabel='Wallet Connect'
|
|
28
28
|
accessibilityState={{ disabled }}
|
|
29
29
|
className={cn(
|
|
30
30
|
'p-4 rounded-lg border',
|
|
@@ -37,7 +37,7 @@ export const WalletConnect: React.FC<WalletConnectProps> = ({
|
|
|
37
37
|
{...props}
|
|
38
38
|
>
|
|
39
39
|
{children || (
|
|
40
|
-
<Text className=
|
|
40
|
+
<Text className='text-gray-900 dark:text-white'>
|
|
41
41
|
WalletConnect Component
|
|
42
42
|
</Text>
|
|
43
43
|
)}
|
package/src/WalletIcon.tsx
CHANGED
|
@@ -17,14 +17,45 @@ export interface WalletIconProps extends ViewProps {
|
|
|
17
17
|
showLabel?: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const walletConfig: Record<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const walletConfig: Record<
|
|
21
|
+
WalletProvider,
|
|
22
|
+
{ label: string; emoji: string; color: string }
|
|
23
|
+
> = {
|
|
24
|
+
metamask: {
|
|
25
|
+
label: 'MetaMask',
|
|
26
|
+
emoji: '🦊',
|
|
27
|
+
color: 'bg-orange-100 dark:bg-orange-900/30',
|
|
28
|
+
},
|
|
29
|
+
walletconnect: {
|
|
30
|
+
label: 'WalletConnect',
|
|
31
|
+
emoji: '🔗',
|
|
32
|
+
color: 'bg-blue-100 dark:bg-blue-900/30',
|
|
33
|
+
},
|
|
34
|
+
coinbase: {
|
|
35
|
+
label: 'Coinbase',
|
|
36
|
+
emoji: '🔵',
|
|
37
|
+
color: 'bg-blue-100 dark:bg-blue-900/30',
|
|
38
|
+
},
|
|
39
|
+
rainbow: {
|
|
40
|
+
label: 'Rainbow',
|
|
41
|
+
emoji: '🌈',
|
|
42
|
+
color: 'bg-purple-100 dark:bg-purple-900/30',
|
|
43
|
+
},
|
|
44
|
+
phantom: {
|
|
45
|
+
label: 'Phantom',
|
|
46
|
+
emoji: '👻',
|
|
47
|
+
color: 'bg-purple-100 dark:bg-purple-900/30',
|
|
48
|
+
},
|
|
49
|
+
trust: {
|
|
50
|
+
label: 'Trust Wallet',
|
|
51
|
+
emoji: '🛡️',
|
|
52
|
+
color: 'bg-blue-100 dark:bg-blue-900/30',
|
|
53
|
+
},
|
|
54
|
+
generic: {
|
|
55
|
+
label: 'Wallet',
|
|
56
|
+
emoji: '💳',
|
|
57
|
+
color: 'bg-gray-100 dark:bg-gray-800',
|
|
58
|
+
},
|
|
28
59
|
};
|
|
29
60
|
|
|
30
61
|
const sizeClasses = {
|
|
@@ -67,7 +98,7 @@ export const WalletIcon: React.FC<WalletIconProps> = ({
|
|
|
67
98
|
<Text className={textSizes[size]}>{config.emoji}</Text>
|
|
68
99
|
</View>
|
|
69
100
|
{showLabel && (
|
|
70
|
-
<Text className=
|
|
101
|
+
<Text className='text-gray-900 dark:text-white font-medium'>
|
|
71
102
|
{config.label}
|
|
72
103
|
</Text>
|
|
73
104
|
)}
|
package/src/WalletSelection.tsx
CHANGED
|
@@ -54,7 +54,7 @@ export const WalletSelectionButton: React.FC<WalletSelectionButtonProps> = ({
|
|
|
54
54
|
<Pressable
|
|
55
55
|
onPress={wallet.onPress}
|
|
56
56
|
disabled={isDisabled}
|
|
57
|
-
accessibilityRole=
|
|
57
|
+
accessibilityRole='button'
|
|
58
58
|
accessibilityLabel={`Connect ${wallet.name} wallet for ${wallet.chainType === 'solana' ? 'Solana' : 'Ethereum'} network`}
|
|
59
59
|
accessibilityState={{ disabled: isDisabled }}
|
|
60
60
|
className={cn(
|
|
@@ -67,10 +67,10 @@ export const WalletSelectionButton: React.FC<WalletSelectionButtonProps> = ({
|
|
|
67
67
|
)}
|
|
68
68
|
{...props}
|
|
69
69
|
>
|
|
70
|
-
<View className=
|
|
71
|
-
<WalletIcon provider={getProviderFromName(wallet.name)} size=
|
|
70
|
+
<View className='flex-row items-center gap-3'>
|
|
71
|
+
<WalletIcon provider={getProviderFromName(wallet.name)} size='md' />
|
|
72
72
|
<View>
|
|
73
|
-
<Text className=
|
|
73
|
+
<Text className='font-medium text-gray-900 dark:text-white'>
|
|
74
74
|
{wallet.name}
|
|
75
75
|
</Text>
|
|
76
76
|
<Text
|
|
@@ -90,7 +90,7 @@ export const WalletSelectionButton: React.FC<WalletSelectionButtonProps> = ({
|
|
|
90
90
|
|
|
91
91
|
{wallet.connecting && (
|
|
92
92
|
<ActivityIndicator
|
|
93
|
-
size=
|
|
93
|
+
size='small'
|
|
94
94
|
color={wallet.chainType === 'solana' ? '#9333ea' : '#2563eb'}
|
|
95
95
|
/>
|
|
96
96
|
)}
|
|
@@ -116,7 +116,7 @@ export const WalletTab: React.FC<WalletTabProps> = ({
|
|
|
116
116
|
return (
|
|
117
117
|
<Pressable
|
|
118
118
|
onPress={onPress}
|
|
119
|
-
accessibilityRole=
|
|
119
|
+
accessibilityRole='tab'
|
|
120
120
|
accessibilityState={{ selected: active }}
|
|
121
121
|
className={cn(
|
|
122
122
|
'flex-1 py-2 px-4 rounded-md',
|
|
@@ -127,7 +127,7 @@ export const WalletTab: React.FC<WalletTabProps> = ({
|
|
|
127
127
|
: 'bg-transparent'
|
|
128
128
|
)}
|
|
129
129
|
>
|
|
130
|
-
<View className=
|
|
130
|
+
<View className='flex-row items-center justify-center gap-2'>
|
|
131
131
|
<Text
|
|
132
132
|
className={cn(
|
|
133
133
|
'text-base',
|
|
@@ -208,26 +208,26 @@ export const WalletSelectionGrid: React.FC<WalletSelectionGridProps> = ({
|
|
|
208
208
|
return (
|
|
209
209
|
<View className={cn('gap-6', className)} {...props}>
|
|
210
210
|
{/* Tab Navigation */}
|
|
211
|
-
<View className=
|
|
211
|
+
<View className='flex-row gap-1 p-1 bg-gray-100 dark:bg-gray-700 rounded-lg'>
|
|
212
212
|
<WalletTab
|
|
213
213
|
active={activeTab === 'ethereum'}
|
|
214
214
|
onPress={() => onTabChange('ethereum')}
|
|
215
|
-
icon=
|
|
215
|
+
icon='⟠'
|
|
216
216
|
label={finalLabels.ethereum}
|
|
217
|
-
color=
|
|
217
|
+
color='blue'
|
|
218
218
|
/>
|
|
219
219
|
<WalletTab
|
|
220
220
|
active={activeTab === 'solana'}
|
|
221
221
|
onPress={() => onTabChange('solana')}
|
|
222
|
-
icon=
|
|
222
|
+
icon='◎'
|
|
223
223
|
label={finalLabels.solana}
|
|
224
|
-
color=
|
|
224
|
+
color='purple'
|
|
225
225
|
/>
|
|
226
226
|
</View>
|
|
227
227
|
|
|
228
228
|
{/* Wallet List */}
|
|
229
|
-
<View className=
|
|
230
|
-
{currentWallets.map(
|
|
229
|
+
<View className='gap-3'>
|
|
230
|
+
{currentWallets.map(wallet => (
|
|
231
231
|
<WalletSelectionButton
|
|
232
232
|
key={wallet.id}
|
|
233
233
|
wallet={{
|
|
@@ -244,11 +244,11 @@ export const WalletSelectionGrid: React.FC<WalletSelectionGridProps> = ({
|
|
|
244
244
|
</View>
|
|
245
245
|
|
|
246
246
|
{/* Help Text */}
|
|
247
|
-
<View className=
|
|
248
|
-
<Text className=
|
|
247
|
+
<View className='items-center pt-2'>
|
|
248
|
+
<Text className='text-sm text-gray-600 dark:text-gray-400'>
|
|
249
249
|
{finalLabels.noWalletText}{' '}
|
|
250
250
|
</Text>
|
|
251
|
-
<Pressable onPress={handleInstallPress} accessibilityRole=
|
|
251
|
+
<Pressable onPress={handleInstallPress} accessibilityRole='link'>
|
|
252
252
|
<Text
|
|
253
253
|
className={cn(
|
|
254
254
|
'text-sm font-medium',
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,11 @@ export { GasTracker, type GasTrackerProps } from './GasTracker';
|
|
|
9
9
|
export { NftGallery, type NftGalleryProps } from './NftGallery';
|
|
10
10
|
export { TokenSwap, type TokenSwapProps } from './TokenSwap';
|
|
11
11
|
export { WalletConnect, type WalletConnectProps } from './WalletConnect';
|
|
12
|
-
export {
|
|
12
|
+
export {
|
|
13
|
+
WalletIcon,
|
|
14
|
+
type WalletIconProps,
|
|
15
|
+
type WalletProvider,
|
|
16
|
+
} from './WalletIcon';
|
|
13
17
|
export {
|
|
14
18
|
WalletSelectionButton,
|
|
15
19
|
WalletSelectionGrid,
|