@reown/appkit-react-native 0.0.0-fix-height-calc-20250815195135 → 0.0.0-fix-ui-changes-20250828183750

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.
Files changed (154) hide show
  1. package/lib/commonjs/AppKit.js +7 -5
  2. package/lib/commonjs/AppKit.js.map +1 -1
  3. package/lib/commonjs/connectors/WalletConnectConnector.js +1 -2
  4. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
  5. package/lib/commonjs/modal/w3m-modal/index.js +1 -6
  6. package/lib/commonjs/modal/w3m-modal/index.js.map +1 -1
  7. package/lib/commonjs/modal/w3m-router/index.js +7 -1
  8. package/lib/commonjs/modal/w3m-router/index.js.map +1 -1
  9. package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js +7 -97
  10. package/lib/commonjs/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
  11. package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js +5 -4
  12. package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
  13. package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js +85 -0
  14. package/lib/commonjs/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
  15. package/lib/commonjs/partials/w3m-all-wallets-list/index.js +7 -41
  16. package/lib/commonjs/partials/w3m-all-wallets-list/index.js.map +1 -1
  17. package/lib/commonjs/partials/w3m-all-wallets-list/styles.js +8 -4
  18. package/lib/commonjs/partials/w3m-all-wallets-list/styles.js.map +1 -1
  19. package/lib/commonjs/partials/w3m-all-wallets-search/index.js +7 -38
  20. package/lib/commonjs/partials/w3m-all-wallets-search/index.js.map +1 -1
  21. package/lib/commonjs/partials/w3m-all-wallets-search/styles.js +2 -2
  22. package/lib/commonjs/partials/w3m-all-wallets-search/styles.js.map +1 -1
  23. package/lib/commonjs/partials/w3m-selector-modal/styles.js +1 -1
  24. package/lib/commonjs/partials/w3m-selector-modal/styles.js.map +1 -1
  25. package/lib/commonjs/views/w3m-all-wallets-view/index.js +2 -19
  26. package/lib/commonjs/views/w3m-all-wallets-view/index.js.map +1 -1
  27. package/lib/commonjs/views/w3m-connect-view/index.js +1 -1
  28. package/lib/commonjs/views/w3m-connect-view/index.js.map +1 -1
  29. package/lib/commonjs/views/w3m-onramp-checkout-view/index.js +160 -152
  30. package/lib/commonjs/views/w3m-onramp-checkout-view/index.js.map +1 -1
  31. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js +1 -1
  32. package/lib/commonjs/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  33. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js +155 -0
  34. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
  35. package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +4 -2
  36. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
  37. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
  38. package/lib/commonjs/views/w3m-swap-view/index.js +4 -10
  39. package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
  40. package/lib/commonjs/views/w3m-swap-view/styles.js +0 -5
  41. package/lib/commonjs/views/w3m-swap-view/styles.js.map +1 -1
  42. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js +1 -2
  43. package/lib/commonjs/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  44. package/lib/commonjs/views/w3m-wallet-send-view/styles.js +1 -1
  45. package/lib/module/AppKit.js +7 -5
  46. package/lib/module/AppKit.js.map +1 -1
  47. package/lib/module/connectors/WalletConnectConnector.js +1 -2
  48. package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
  49. package/lib/module/modal/w3m-modal/index.js +2 -7
  50. package/lib/module/modal/w3m-modal/index.js.map +1 -1
  51. package/lib/module/modal/w3m-router/index.js +7 -1
  52. package/lib/module/modal/w3m-router/index.js.map +1 -1
  53. package/lib/module/partials/w3m-all-wallets-list/components/Loading.js +8 -98
  54. package/lib/module/partials/w3m-all-wallets-list/components/Loading.js.map +1 -1
  55. package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js +5 -4
  56. package/lib/module/partials/w3m-all-wallets-list/components/WalletItem.js.map +1 -1
  57. package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js +81 -0
  58. package/lib/module/partials/w3m-all-wallets-list/components/WalletList.js.map +1 -0
  59. package/lib/module/partials/w3m-all-wallets-list/index.js +7 -41
  60. package/lib/module/partials/w3m-all-wallets-list/index.js.map +1 -1
  61. package/lib/module/partials/w3m-all-wallets-list/styles.js +8 -4
  62. package/lib/module/partials/w3m-all-wallets-list/styles.js.map +1 -1
  63. package/lib/module/partials/w3m-all-wallets-search/index.js +8 -39
  64. package/lib/module/partials/w3m-all-wallets-search/index.js.map +1 -1
  65. package/lib/module/partials/w3m-all-wallets-search/styles.js +2 -2
  66. package/lib/module/partials/w3m-all-wallets-search/styles.js.map +1 -1
  67. package/lib/module/partials/w3m-selector-modal/styles.js +1 -1
  68. package/lib/module/partials/w3m-selector-modal/styles.js.map +1 -1
  69. package/lib/module/views/w3m-all-wallets-view/index.js +3 -20
  70. package/lib/module/views/w3m-all-wallets-view/index.js.map +1 -1
  71. package/lib/module/views/w3m-connect-view/index.js +1 -1
  72. package/lib/module/views/w3m-connect-view/index.js.map +1 -1
  73. package/lib/module/views/w3m-onramp-checkout-view/index.js +162 -154
  74. package/lib/module/views/w3m-onramp-checkout-view/index.js.map +1 -1
  75. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js +1 -1
  76. package/lib/module/views/w3m-onramp-view/components/SelectPaymentModal.js.map +1 -1
  77. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js +150 -0
  78. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -0
  79. package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.js +4 -2
  80. package/lib/module/views/w3m-swap-view/components/select-token-modal/styles.js.map +1 -0
  81. package/lib/module/views/w3m-swap-view/components/select-token-modal/utils.js.map +1 -0
  82. package/lib/module/views/w3m-swap-view/index.js +5 -11
  83. package/lib/module/views/w3m-swap-view/index.js.map +1 -1
  84. package/lib/module/views/w3m-swap-view/styles.js +0 -5
  85. package/lib/module/views/w3m-swap-view/styles.js.map +1 -1
  86. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js +1 -2
  87. package/lib/module/views/w3m-wallet-compatible-networks-view/index.js.map +1 -1
  88. package/lib/module/views/w3m-wallet-send-view/styles.js +1 -1
  89. package/lib/typescript/AppKit.d.ts.map +1 -1
  90. package/lib/typescript/modal/w3m-modal/index.d.ts.map +1 -1
  91. package/lib/typescript/modal/w3m-router/index.d.ts.map +1 -1
  92. package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts +2 -4
  93. package/lib/typescript/partials/w3m-all-wallets-list/components/Loading.d.ts.map +1 -1
  94. package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts +2 -1
  95. package/lib/typescript/partials/w3m-all-wallets-list/components/WalletItem.d.ts.map +1 -1
  96. package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts +12 -0
  97. package/lib/typescript/partials/w3m-all-wallets-list/components/WalletList.d.ts.map +1 -0
  98. package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts +1 -3
  99. package/lib/typescript/partials/w3m-all-wallets-list/index.d.ts.map +1 -1
  100. package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts +7 -3
  101. package/lib/typescript/partials/w3m-all-wallets-list/styles.d.ts.map +1 -1
  102. package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts +1 -4
  103. package/lib/typescript/partials/w3m-all-wallets-search/index.d.ts.map +1 -1
  104. package/lib/typescript/partials/w3m-all-wallets-search/styles.d.ts +1 -1
  105. package/lib/typescript/partials/w3m-selector-modal/styles.d.ts +1 -1
  106. package/lib/typescript/views/w3m-all-wallets-view/index.d.ts.map +1 -1
  107. package/lib/typescript/views/w3m-onramp-checkout-view/index.d.ts.map +1 -1
  108. package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/index.d.ts +2 -1
  109. package/lib/typescript/views/w3m-swap-view/components/select-token-modal/index.d.ts.map +1 -0
  110. package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts +4 -2
  111. package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.d.ts.map +1 -1
  112. package/lib/typescript/views/w3m-swap-view/components/select-token-modal/utils.d.ts.map +1 -0
  113. package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
  114. package/lib/typescript/views/w3m-swap-view/styles.d.ts +0 -5
  115. package/lib/typescript/views/w3m-swap-view/styles.d.ts.map +1 -1
  116. package/lib/typescript/views/w3m-wallet-send-view/styles.d.ts +1 -1
  117. package/package.json +5 -5
  118. package/src/AppKit.ts +13 -5
  119. package/src/connectors/WalletConnectConnector.ts +2 -2
  120. package/src/modal/w3m-modal/index.tsx +2 -3
  121. package/src/modal/w3m-router/index.tsx +3 -1
  122. package/src/partials/w3m-all-wallets-list/components/Loading.tsx +4 -35
  123. package/src/partials/w3m-all-wallets-list/components/WalletItem.tsx +5 -3
  124. package/src/partials/w3m-all-wallets-list/components/WalletList.tsx +92 -0
  125. package/src/partials/w3m-all-wallets-list/index.tsx +7 -38
  126. package/src/partials/w3m-all-wallets-list/styles.ts +8 -4
  127. package/src/partials/w3m-all-wallets-search/index.tsx +6 -43
  128. package/src/partials/w3m-all-wallets-search/styles.ts +2 -2
  129. package/src/partials/w3m-selector-modal/styles.ts +1 -1
  130. package/src/views/w3m-all-wallets-view/index.tsx +2 -29
  131. package/src/views/w3m-connect-view/index.tsx +1 -1
  132. package/src/views/w3m-onramp-checkout-view/index.tsx +147 -143
  133. package/src/views/w3m-onramp-view/components/SelectPaymentModal.tsx +1 -1
  134. package/src/views/w3m-swap-view/components/select-token-modal/index.tsx +182 -0
  135. package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/styles.ts +4 -2
  136. package/src/views/w3m-swap-view/index.tsx +3 -5
  137. package/src/views/w3m-swap-view/styles.ts +1 -5
  138. package/src/views/w3m-wallet-compatible-networks-view/index.tsx +1 -1
  139. package/src/views/w3m-wallet-send-view/styles.ts +1 -1
  140. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js +0 -145
  141. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
  142. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
  143. package/lib/commonjs/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
  144. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js +0 -140
  145. package/lib/module/views/w3m-swap-view/components/select-token-view/index.js.map +0 -1
  146. package/lib/module/views/w3m-swap-view/components/select-token-view/styles.js.map +0 -1
  147. package/lib/module/views/w3m-swap-view/components/select-token-view/utils.js.map +0 -1
  148. package/lib/typescript/views/w3m-swap-view/components/select-token-view/index.d.ts.map +0 -1
  149. package/lib/typescript/views/w3m-swap-view/components/select-token-view/utils.d.ts.map +0 -1
  150. package/src/views/w3m-swap-view/components/select-token-view/index.tsx +0 -176
  151. /package/lib/commonjs/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
  152. /package/lib/module/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.js +0 -0
  153. /package/lib/typescript/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.d.ts +0 -0
  154. /package/src/views/w3m-swap-view/components/{select-token-view → select-token-modal}/utils.ts +0 -0
@@ -15,14 +15,16 @@ import {
15
15
  Spacing,
16
16
  Text,
17
17
  Toggle,
18
+ useCustomDimensions,
18
19
  useTheme
19
20
  } from '@reown/appkit-ui-react-native';
20
- import { StyleSheet } from 'react-native';
21
+ import { ScrollView, StyleSheet } from 'react-native';
21
22
  import { useSnapshot } from 'valtio';
22
23
  import { NumberUtil, StringUtil } from '@reown/appkit-common-react-native';
23
24
 
24
25
  export function OnRampCheckoutView() {
25
26
  const Theme = useTheme();
27
+ const { padding } = useCustomDimensions();
26
28
  const { themeMode } = useSnapshot(ThemeController.state);
27
29
  const { networkImages } = useSnapshot(AssetController.state);
28
30
  const { selectedQuote, selectedPaymentMethod, purchaseCurrency } = useSnapshot(
@@ -49,164 +51,166 @@ export function OnRampCheckoutView() {
49
51
  };
50
52
 
51
53
  return (
52
- <FlexView padding={['2xl', 'l', '4xl', 'l']}>
53
- <FlexView alignItems="center">
54
- <Text color="fg-200">You Buy</Text>
55
- <FlexView flexDirection="row" alignItems="center">
56
- <Text style={[styles.amount, { color: Theme['fg-100'] }]}>{value}</Text>
57
- <Text variant="paragraph-400" color="fg-200">
58
- {symbol?.split('_')[0] ?? symbol ?? ''}
59
- </Text>
60
- </FlexView>
61
- <FlexView flexDirection="row" alignItems="center" justifyContent="center">
62
- <Text color="fg-200">via </Text>
63
- {providerImage ? <Image source={providerImage} style={styles.providerImage} /> : null}
64
- <Text color="fg-200">{StringUtil.capitalize(selectedQuote?.serviceProvider)}</Text>
54
+ <ScrollView style={{ paddingHorizontal: padding }}>
55
+ <FlexView padding={['2xl', 'l', '4xl', 'l']}>
56
+ <FlexView alignItems="center">
57
+ <Text color="fg-200">You Buy</Text>
58
+ <FlexView flexDirection="row" alignItems="center">
59
+ <Text style={[styles.amount, { color: Theme['fg-100'] }]}>{value}</Text>
60
+ <Text variant="paragraph-400" color="fg-200">
61
+ {symbol?.split('_')[0] ?? symbol ?? ''}
62
+ </Text>
63
+ </FlexView>
64
+ <FlexView flexDirection="row" alignItems="center" justifyContent="center">
65
+ <Text color="fg-200">via </Text>
66
+ {providerImage ? <Image source={providerImage} style={styles.providerImage} /> : null}
67
+ <Text color="fg-200">{StringUtil.capitalize(selectedQuote?.serviceProvider)}</Text>
68
+ </FlexView>
65
69
  </FlexView>
66
- </FlexView>
67
- <Separator style={styles.separator} color="gray-glass-010" />
68
- <FlexView
69
- padding={['s', 's', 'xs', 's']}
70
- flexDirection="row"
71
- justifyContent="space-between"
72
- alignItems="center"
73
- >
74
- <Text color="fg-200">You Pay</Text>
75
- <Text>
76
- {selectedQuote?.sourceAmount} {selectedQuote?.sourceCurrencyCode}
77
- </Text>
78
- </FlexView>
79
- <FlexView
80
- padding={['xs', 's', 'xs', 's']}
81
- flexDirection="row"
82
- justifyContent="space-between"
83
- alignItems="center"
84
- >
85
- <Text color="fg-200">You Receive</Text>
86
- <FlexView flexDirection="row" alignItems="center">
70
+ <Separator style={styles.separator} color="gray-glass-010" />
71
+ <FlexView
72
+ padding={['s', 's', 'xs', 's']}
73
+ flexDirection="row"
74
+ justifyContent="space-between"
75
+ alignItems="center"
76
+ >
77
+ <Text color="fg-200">You Pay</Text>
87
78
  <Text>
88
- {value} {symbol?.split('_')[0] ?? ''}
79
+ {selectedQuote?.sourceAmount} {selectedQuote?.sourceCurrencyCode}
89
80
  </Text>
90
- {purchaseCurrency?.symbolImageUrl ? (
91
- <Image
92
- source={purchaseCurrency?.symbolImageUrl}
93
- style={[styles.tokenImage, { borderColor: Theme['gray-glass-010'] }]}
94
- />
95
- ) : null}
96
81
  </FlexView>
97
- </FlexView>
98
- <FlexView
99
- padding={['xs', 's', 'xs', 's']}
100
- flexDirection="row"
101
- alignItems="center"
102
- justifyContent="space-between"
103
- >
104
- <Text color="fg-200">Network</Text>
105
- <FlexView flexDirection="row" alignItems="center">
106
- <Text>{purchaseCurrency?.chainName}</Text>
82
+ <FlexView
83
+ padding={['xs', 's', 'xs', 's']}
84
+ flexDirection="row"
85
+ justifyContent="space-between"
86
+ alignItems="center"
87
+ >
88
+ <Text color="fg-200">You Receive</Text>
89
+ <FlexView flexDirection="row" alignItems="center">
90
+ <Text>
91
+ {value} {symbol?.split('_')[0] ?? ''}
92
+ </Text>
93
+ {purchaseCurrency?.symbolImageUrl ? (
94
+ <Image
95
+ source={purchaseCurrency?.symbolImageUrl}
96
+ style={[styles.tokenImage, { borderColor: Theme['gray-glass-010'] }]}
97
+ />
98
+ ) : null}
99
+ </FlexView>
107
100
  </FlexView>
108
- </FlexView>
109
- <FlexView
110
- padding={['xs', 's', 'm', 's']}
111
- flexDirection="row"
112
- alignItems="center"
113
- justifyContent="space-between"
114
- >
115
- <Text color="fg-200">Pay with</Text>
116
101
  <FlexView
102
+ padding={['xs', 's', 'xs', 's']}
117
103
  flexDirection="row"
118
104
  alignItems="center"
119
- style={[styles.paymentMethodContainer, { borderColor: Theme['gray-glass-020'] }]}
105
+ justifyContent="space-between"
120
106
  >
121
- {paymentLogo ? (
122
- <Image
123
- source={paymentLogo}
124
- style={styles.paymentMethodImage}
125
- tintColor={Theme['fg-150']}
126
- />
127
- ) : null}
128
- <Text variant="small-600" color="fg-150">
129
- {selectedPaymentMethod?.name}
130
- </Text>
107
+ <Text color="fg-200">Network</Text>
108
+ <FlexView flexDirection="row" alignItems="center">
109
+ <Text>{purchaseCurrency?.chainName}</Text>
110
+ </FlexView>
111
+ </FlexView>
112
+ <FlexView
113
+ padding={['xs', 's', 'm', 's']}
114
+ flexDirection="row"
115
+ alignItems="center"
116
+ justifyContent="space-between"
117
+ >
118
+ <Text color="fg-200">Pay with</Text>
119
+ <FlexView
120
+ flexDirection="row"
121
+ alignItems="center"
122
+ style={[styles.paymentMethodContainer, { borderColor: Theme['gray-glass-020'] }]}
123
+ >
124
+ {paymentLogo ? (
125
+ <Image
126
+ source={paymentLogo}
127
+ style={styles.paymentMethodImage}
128
+ tintColor={Theme['fg-150']}
129
+ />
130
+ ) : null}
131
+ <Text variant="small-600" color="fg-150">
132
+ {selectedPaymentMethod?.name}
133
+ </Text>
134
+ </FlexView>
131
135
  </FlexView>
132
- </FlexView>
133
136
 
134
- {showFees ? (
135
- <Toggle
136
- title={
137
- <>
138
- <Text variant="paragraph-400" color="fg-200">
139
- Fees{' '}
140
- {showTotalFee ? (
141
- <Text variant="paragraph-400">
142
- {selectedQuote?.totalFee} {selectedQuote?.sourceCurrencyCode}
137
+ {showFees ? (
138
+ <Toggle
139
+ title={
140
+ <>
141
+ <Text variant="paragraph-400" color="fg-200">
142
+ Fees{' '}
143
+ {showTotalFee ? (
144
+ <Text variant="paragraph-400">
145
+ {selectedQuote?.totalFee} {selectedQuote?.sourceCurrencyCode}
146
+ </Text>
147
+ ) : null}
148
+ </Text>
149
+ </>
150
+ }
151
+ style={[styles.feesToggle, { backgroundColor: Theme['gray-glass-002'] }]}
152
+ contentContainerStyle={styles.feesToggleContent}
153
+ >
154
+ {showNetworkFee ? (
155
+ <FlexView
156
+ flexDirection="row"
157
+ justifyContent="space-between"
158
+ style={[styles.toggleItem, { backgroundColor: Theme['gray-glass-002'] }]}
159
+ margin={['0', '0', 'xs', '0']}
160
+ >
161
+ <Text variant="small-500" color="fg-150">
162
+ Network Fees
163
+ </Text>
164
+ <FlexView flexDirection="row" alignItems="center">
165
+ {networkImage ? (
166
+ <Image
167
+ source={networkImage}
168
+ style={[styles.networkImage, { borderColor: Theme['gray-glass-010'] }]}
169
+ />
170
+ ) : null}
171
+ <Text variant="small-400">
172
+ {selectedQuote?.networkFee} {selectedQuote?.sourceCurrencyCode}
143
173
  </Text>
144
- ) : null}
145
- </Text>
146
- </>
147
- }
148
- style={[styles.feesToggle, { backgroundColor: Theme['gray-glass-002'] }]}
149
- contentContainerStyle={styles.feesToggleContent}
150
- >
151
- {showNetworkFee ? (
152
- <FlexView
153
- flexDirection="row"
154
- justifyContent="space-between"
155
- style={[styles.toggleItem, { backgroundColor: Theme['gray-glass-002'] }]}
156
- margin={['0', '0', 'xs', '0']}
157
- >
158
- <Text variant="small-500" color="fg-150">
159
- Network Fees
160
- </Text>
161
- <FlexView flexDirection="row" alignItems="center">
162
- {networkImage ? (
163
- <Image
164
- source={networkImage}
165
- style={[styles.networkImage, { borderColor: Theme['gray-glass-010'] }]}
166
- />
167
- ) : null}
174
+ </FlexView>
175
+ </FlexView>
176
+ ) : null}
177
+ {showTransactionFee ? (
178
+ <FlexView
179
+ flexDirection="row"
180
+ justifyContent="space-between"
181
+ style={[styles.toggleItem, { backgroundColor: Theme['gray-glass-002'] }]}
182
+ >
183
+ <Text variant="small-500" color="fg-150">
184
+ Transaction Fees
185
+ </Text>
168
186
  <Text variant="small-400">
169
- {selectedQuote?.networkFee} {selectedQuote?.sourceCurrencyCode}
187
+ {selectedQuote.transactionFee} {selectedQuote?.sourceCurrencyCode}
170
188
  </Text>
171
189
  </FlexView>
172
- </FlexView>
173
- ) : null}
174
- {showTransactionFee ? (
175
- <FlexView
176
- flexDirection="row"
177
- justifyContent="space-between"
178
- style={[styles.toggleItem, { backgroundColor: Theme['gray-glass-002'] }]}
179
- >
180
- <Text variant="small-500" color="fg-150">
181
- Transaction Fees
182
- </Text>
183
- <Text variant="small-400">
184
- {selectedQuote.transactionFee} {selectedQuote?.sourceCurrencyCode}
185
- </Text>
186
- </FlexView>
187
- ) : null}
188
- </Toggle>
189
- ) : null}
190
- <FlexView flexDirection="row" justifyContent="space-between" margin={['xl', '0', '0', '0']}>
191
- <Button
192
- variant="shade"
193
- size="md"
194
- style={styles.cancelButton}
195
- onPress={RouterController.goBack}
196
- >
197
- Back
198
- </Button>
199
- <Button
200
- variant="fill"
201
- size="md"
202
- style={styles.confirmButton}
203
- onPress={onConfirm}
204
- testID="button-confirm"
205
- >
206
- Confirm
207
- </Button>
190
+ ) : null}
191
+ </Toggle>
192
+ ) : null}
193
+ <FlexView flexDirection="row" justifyContent="space-between" margin={['xl', '0', '0', '0']}>
194
+ <Button
195
+ variant="shade"
196
+ size="md"
197
+ style={styles.cancelButton}
198
+ onPress={RouterController.goBack}
199
+ >
200
+ Back
201
+ </Button>
202
+ <Button
203
+ variant="fill"
204
+ size="md"
205
+ style={styles.confirmButton}
206
+ onPress={onConfirm}
207
+ testID="button-confirm"
208
+ >
209
+ Confirm
210
+ </Button>
211
+ </FlexView>
208
212
  </FlexView>
209
- </FlexView>
213
+ </ScrollView>
210
214
  );
211
215
  }
212
216
 
@@ -196,7 +196,7 @@ const styles = StyleSheet.create({
196
196
  paddingTop: Spacing.m
197
197
  },
198
198
  container: {
199
- height: '80%',
199
+ height: '100%',
200
200
  borderTopLeftRadius: BorderRadius.l,
201
201
  borderTopRightRadius: BorderRadius.l
202
202
  },
@@ -0,0 +1,182 @@
1
+ import { useState } from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import {
4
+ Modal,
5
+ ScrollView,
6
+ SectionList,
7
+ View,
8
+ type SectionListData,
9
+ type StyleProp,
10
+ type ViewStyle
11
+ } from 'react-native';
12
+ import {
13
+ FlexView,
14
+ IconLink,
15
+ InputText,
16
+ ListToken,
17
+ ListTokenTotalHeight,
18
+ Separator,
19
+ Text,
20
+ TokenButton,
21
+ useTheme,
22
+ useCustomDimensions
23
+ } from '@reown/appkit-ui-react-native';
24
+
25
+ import {
26
+ AssetController,
27
+ AssetUtil,
28
+ ConnectionsController,
29
+ SwapController,
30
+ type SwapControllerState
31
+ } from '@reown/appkit-core-react-native';
32
+
33
+ import { type SwapInputTarget, type SwapTokenWithBalance } from '@reown/appkit-common-react-native';
34
+
35
+ import { Placeholder } from '../../../../partials/w3m-placeholder';
36
+ import styles from './styles';
37
+ import { createSections } from './utils';
38
+
39
+ interface Props {
40
+ onClose: () => void;
41
+ visible: boolean;
42
+ type?: SwapInputTarget;
43
+ style?: StyleProp<ViewStyle>;
44
+ }
45
+
46
+ export function SwapSelectTokenModal({ onClose, type, style, visible }: Props) {
47
+ const { padding } = useCustomDimensions();
48
+ const Theme = useTheme();
49
+ const { activeNetwork } = useSnapshot(ConnectionsController.state);
50
+ const { networkImages } = useSnapshot(AssetController.state);
51
+ const { sourceToken, suggestedTokens, myTokensWithBalance } = useSnapshot(
52
+ SwapController.state
53
+ ) as SwapControllerState;
54
+
55
+ const networkImage = AssetUtil.getNetworkImage(activeNetwork, networkImages);
56
+ const [tokenSearch, setTokenSearch] = useState<string>('');
57
+ const isSourceToken = type === 'sourceToken';
58
+
59
+ const [filteredTokens, setFilteredTokens] = useState(
60
+ createSections(isSourceToken, tokenSearch, myTokensWithBalance)
61
+ );
62
+ const suggestedList = suggestedTokens
63
+ ?.filter(token => token.address !== SwapController.state.sourceToken?.address)
64
+ .slice(0, 8);
65
+
66
+ const onSearchChange = (value: string) => {
67
+ setTokenSearch(value);
68
+ setFilteredTokens(createSections(isSourceToken, value, myTokensWithBalance));
69
+ };
70
+
71
+ const onTokenPress = (token: SwapTokenWithBalance) => {
72
+ if (isSourceToken) {
73
+ SwapController.setSourceToken(token);
74
+ } else {
75
+ SwapController.setToToken(token);
76
+ if (SwapController.state.sourceToken && SwapController.state.sourceTokenAmount) {
77
+ SwapController.swapTokens();
78
+ }
79
+ }
80
+ onClose();
81
+ };
82
+
83
+ return (
84
+ <Modal visible={visible} transparent animationType="slide" onRequestClose={onClose}>
85
+ <FlexView
86
+ padding={['xl', '0', '0', '0']}
87
+ style={[
88
+ styles.container,
89
+ {
90
+ paddingHorizontal: padding,
91
+ backgroundColor: Theme['bg-100']
92
+ },
93
+ style
94
+ ]}
95
+ >
96
+ <FlexView
97
+ flexDirection="row"
98
+ justifyContent="space-between"
99
+ alignItems="center"
100
+ padding={['0', 'm', 'm', 'm']}
101
+ >
102
+ <IconLink icon="chevronLeft" size="md" onPress={onClose} />
103
+ <Text variant="paragraph-600">Select token</Text>
104
+ <View style={styles.iconPlaceholder} />
105
+ </FlexView>
106
+ <FlexView margin={['0', '0', 'xs', '0']}>
107
+ <InputText
108
+ value={tokenSearch}
109
+ icon="search"
110
+ placeholder="Search token"
111
+ onChangeText={onSearchChange}
112
+ clearButtonMode="while-editing"
113
+ style={styles.input}
114
+ />
115
+ {!isSourceToken && (
116
+ <>
117
+ <ScrollView
118
+ horizontal
119
+ showsHorizontalScrollIndicator={false}
120
+ bounces={false}
121
+ fadingEdgeLength={20}
122
+ style={styles.suggestedList}
123
+ contentContainerStyle={styles.suggestedListContent}
124
+ >
125
+ {suggestedList?.map((token, index) => (
126
+ <TokenButton
127
+ key={token.name}
128
+ text={token.symbol}
129
+ imageUrl={token.logoUri}
130
+ onPress={() => onTokenPress(token)}
131
+ style={index !== suggestedList.length - 1 ? styles.suggestedToken : undefined}
132
+ />
133
+ ))}
134
+ </ScrollView>
135
+ <Separator style={styles.suggestedSeparator} color="gray-glass-005" />
136
+ </>
137
+ )}
138
+ </FlexView>
139
+ <SectionList
140
+ sections={filteredTokens as SectionListData<SwapTokenWithBalance>[]}
141
+ bounces={false}
142
+ fadingEdgeLength={20}
143
+ contentContainerStyle={styles.tokenList}
144
+ renderSectionHeader={({ section: { title } }) => (
145
+ <Text
146
+ variant="paragraph-500"
147
+ color="fg-200"
148
+ style={[{ backgroundColor: Theme['bg-100'] }, styles.title]}
149
+ >
150
+ {title}
151
+ </Text>
152
+ )}
153
+ ListEmptyComponent={
154
+ <Placeholder
155
+ icon="coinPlaceholder"
156
+ title="No tokens found"
157
+ description="Your tokens will appear here"
158
+ />
159
+ }
160
+ getItemLayout={(_, index) => ({
161
+ length: ListTokenTotalHeight,
162
+ offset: ListTokenTotalHeight * index,
163
+ index
164
+ })}
165
+ renderItem={({ item }) => (
166
+ <ListToken
167
+ key={item.name}
168
+ name={item.name}
169
+ imageSrc={item.logoUri}
170
+ networkSrc={networkImage}
171
+ value={item.value}
172
+ amount={item.quantity.numeric}
173
+ currency={item.symbol}
174
+ onPress={() => onTokenPress(item)}
175
+ disabled={item.address === sourceToken?.address}
176
+ />
177
+ )}
178
+ />
179
+ </FlexView>
180
+ </Modal>
181
+ );
182
+ }
@@ -8,7 +8,9 @@ export default StyleSheet.create({
8
8
  borderBottomLeftRadius: 0,
9
9
  borderBottomRightRadius: 0,
10
10
  overflow: 'hidden',
11
- marginTop: 80
11
+ margin: 0,
12
+ flex: 1,
13
+ justifyContent: 'flex-end'
12
14
  },
13
15
  title: {
14
16
  paddingTop: Spacing['2xs']
@@ -29,7 +31,7 @@ export default StyleSheet.create({
29
31
  marginRight: Spacing.s
30
32
  },
31
33
  suggestedSeparator: {
32
- marginVertical: Spacing.s
34
+ marginTop: Spacing.s
33
35
  },
34
36
  iconPlaceholder: {
35
37
  height: 32,
@@ -1,6 +1,6 @@
1
1
  import { useSnapshot } from 'valtio';
2
2
  import { useEffect, useState } from 'react';
3
- import { ScrollView, Modal } from 'react-native';
3
+ import { ScrollView } from 'react-native';
4
4
  import {
5
5
  ConnectionsController,
6
6
  ConstantsUtil,
@@ -22,7 +22,7 @@ import { SwapInput } from '../../partials/w3m-swap-input';
22
22
  import { useDebounceCallback } from '../../hooks/useDebounceCallback';
23
23
  import { SwapDetails } from '../../partials/w3m-swap-details';
24
24
  import styles from './styles';
25
- import { SwapSelectTokenView } from './components/select-token-view';
25
+ import { SwapSelectTokenModal } from './components/select-token-modal';
26
26
 
27
27
  export function SwapView() {
28
28
  const {
@@ -208,9 +208,7 @@ export function SwapView() {
208
208
  </Button>
209
209
  </FlexView>
210
210
  </ScrollView>
211
- <Modal visible={!!showModal} transparent animationType="slide" onRequestClose={onModalClose}>
212
- <SwapSelectTokenView style={styles.modalContent} onClose={onModalClose} type={showModal} />
213
- </Modal>
211
+ <SwapSelectTokenModal visible={!!showModal} onClose={onModalClose} type={showModal} />
214
212
  </>
215
213
  );
216
214
  }
@@ -20,11 +20,7 @@ export default StyleSheet.create({
20
20
  marginTop: Spacing.xs,
21
21
  width: '100%'
22
22
  },
23
- modalContent: {
24
- margin: 0,
25
- flex: 1,
26
- justifyContent: 'flex-end'
27
- },
23
+
28
24
  withKeyboard: {
29
25
  height: '100%'
30
26
  }
@@ -31,7 +31,7 @@ export function WalletCompatibleNetworks() {
31
31
 
32
32
  return (
33
33
  <ScrollView bounces={false} style={{ paddingHorizontal: padding }} fadingEdgeLength={20}>
34
- <FlexView padding={['xl', 's', '2xl', 's']} margin={['0', '0', '2xl', '0']}>
34
+ <FlexView padding={['xl', 's', 's', 's']}>
35
35
  <Banner icon="warningCircle" text="You can only receive assets on these networks." />
36
36
  {approvedNetworks.map((network, index) => (
37
37
  <FlexView
@@ -19,6 +19,6 @@ export default StyleSheet.create({
19
19
  width: '100%'
20
20
  },
21
21
  withKeyboard: {
22
- height: '100%'
22
+ height: '80%'
23
23
  }
24
24
  });