@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.
@@ -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="button"
27
- accessibilityLabel="Wallet Connect"
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="text-gray-900 dark:text-white">
40
+ <Text className='text-gray-900 dark:text-white'>
41
41
  WalletConnect Component
42
42
  </Text>
43
43
  )}
@@ -17,14 +17,45 @@ export interface WalletIconProps extends ViewProps {
17
17
  showLabel?: boolean;
18
18
  }
19
19
 
20
- const walletConfig: Record<WalletProvider, { label: string; emoji: string; color: string }> = {
21
- metamask: { label: 'MetaMask', emoji: '🦊', color: 'bg-orange-100 dark:bg-orange-900/30' },
22
- walletconnect: { label: 'WalletConnect', emoji: '🔗', color: 'bg-blue-100 dark:bg-blue-900/30' },
23
- coinbase: { label: 'Coinbase', emoji: '🔵', color: 'bg-blue-100 dark:bg-blue-900/30' },
24
- rainbow: { label: 'Rainbow', emoji: '🌈', color: 'bg-purple-100 dark:bg-purple-900/30' },
25
- phantom: { label: 'Phantom', emoji: '👻', color: 'bg-purple-100 dark:bg-purple-900/30' },
26
- trust: { label: 'Trust Wallet', emoji: '🛡️', color: 'bg-blue-100 dark:bg-blue-900/30' },
27
- generic: { label: 'Wallet', emoji: '💳', color: 'bg-gray-100 dark:bg-gray-800' },
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="text-gray-900 dark:text-white font-medium">
101
+ <Text className='text-gray-900 dark:text-white font-medium'>
71
102
  {config.label}
72
103
  </Text>
73
104
  )}
@@ -54,7 +54,7 @@ export const WalletSelectionButton: React.FC<WalletSelectionButtonProps> = ({
54
54
  <Pressable
55
55
  onPress={wallet.onPress}
56
56
  disabled={isDisabled}
57
- accessibilityRole="button"
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="flex-row items-center gap-3">
71
- <WalletIcon provider={getProviderFromName(wallet.name)} size="md" />
70
+ <View className='flex-row items-center gap-3'>
71
+ <WalletIcon provider={getProviderFromName(wallet.name)} size='md' />
72
72
  <View>
73
- <Text className="font-medium text-gray-900 dark:text-white">
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="small"
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="tab"
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="flex-row items-center justify-center gap-2">
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="flex-row gap-1 p-1 bg-gray-100 dark:bg-gray-700 rounded-lg">
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="blue"
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="purple"
224
+ color='purple'
225
225
  />
226
226
  </View>
227
227
 
228
228
  {/* Wallet List */}
229
- <View className="gap-3">
230
- {currentWallets.map((wallet) => (
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="items-center pt-2">
248
- <Text className="text-sm text-gray-600 dark:text-gray-400">
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="link">
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 { WalletIcon, type WalletIconProps, type WalletProvider } from './WalletIcon';
12
+ export {
13
+ WalletIcon,
14
+ type WalletIconProps,
15
+ type WalletProvider,
16
+ } from './WalletIcon';
13
17
  export {
14
18
  WalletSelectionButton,
15
19
  WalletSelectionGrid,