@reown/appkit-ui-react-native 0.0.0-canary-20240912195440 → 0.0.0-develop-20240925193922

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 (280) hide show
  1. package/lib/commonjs/assets/svg/ArrowBottomCircle.js +21 -0
  2. package/lib/commonjs/assets/svg/ArrowBottomCircle.js.map +1 -0
  3. package/lib/commonjs/assets/svg/Paperplane.js +21 -0
  4. package/lib/commonjs/assets/svg/Paperplane.js.map +1 -0
  5. package/lib/commonjs/components/wui-icon/index.js +4 -0
  6. package/lib/commonjs/components/wui-icon/index.js.map +1 -1
  7. package/lib/commonjs/composites/wui-account-button/index.js +13 -7
  8. package/lib/commonjs/composites/wui-account-button/index.js.map +1 -1
  9. package/lib/commonjs/composites/wui-account-button/styles.js +3 -3
  10. package/lib/commonjs/composites/wui-account-button/styles.js.map +1 -1
  11. package/lib/commonjs/composites/wui-account-pill/index.js +73 -0
  12. package/lib/commonjs/composites/wui-account-pill/index.js.map +1 -0
  13. package/lib/commonjs/composites/wui-account-pill/styles.js +25 -0
  14. package/lib/commonjs/composites/wui-account-pill/styles.js.map +1 -0
  15. package/lib/commonjs/composites/wui-avatar/styles.js +2 -1
  16. package/lib/commonjs/composites/wui-avatar/styles.js.map +1 -1
  17. package/lib/commonjs/composites/wui-balance/index.js +27 -0
  18. package/lib/commonjs/composites/wui-balance/index.js.map +1 -0
  19. package/lib/commonjs/composites/wui-banner/index.js +36 -0
  20. package/lib/commonjs/composites/wui-banner/index.js.map +1 -0
  21. package/lib/commonjs/composites/wui-banner/styles.js +21 -0
  22. package/lib/commonjs/composites/wui-banner/styles.js.map +1 -0
  23. package/lib/commonjs/composites/wui-button/index.js +3 -3
  24. package/lib/commonjs/composites/wui-button/index.js.map +1 -1
  25. package/lib/commonjs/composites/wui-button/styles.js +2 -2
  26. package/lib/commonjs/composites/wui-button/styles.js.map +1 -1
  27. package/lib/commonjs/composites/wui-chip/index.js +5 -7
  28. package/lib/commonjs/composites/wui-chip/index.js.map +1 -1
  29. package/lib/commonjs/composites/wui-chip/styles.js +1 -1
  30. package/lib/commonjs/composites/wui-chip/styles.js.map +1 -1
  31. package/lib/commonjs/composites/wui-compatible-network/index.js +58 -0
  32. package/lib/commonjs/composites/wui-compatible-network/index.js.map +1 -0
  33. package/lib/commonjs/composites/wui-list-item/index.js +10 -10
  34. package/lib/commonjs/composites/wui-list-item/index.js.map +1 -1
  35. package/lib/commonjs/composites/wui-list-item/styles.js +4 -3
  36. package/lib/commonjs/composites/wui-list-item/styles.js.map +1 -1
  37. package/lib/commonjs/composites/wui-list-token/index.js +78 -0
  38. package/lib/commonjs/composites/wui-list-token/index.js.map +1 -0
  39. package/lib/commonjs/composites/wui-list-token/styles.js +30 -0
  40. package/lib/commonjs/composites/wui-list-token/styles.js.map +1 -0
  41. package/lib/commonjs/composites/wui-list-transaction/index.js +64 -0
  42. package/lib/commonjs/composites/wui-list-transaction/index.js.map +1 -0
  43. package/lib/commonjs/composites/wui-list-transaction/styles.js +16 -0
  44. package/lib/commonjs/composites/wui-list-transaction/styles.js.map +1 -0
  45. package/lib/commonjs/composites/wui-list-transaction/utils.js +88 -0
  46. package/lib/commonjs/composites/wui-list-transaction/utils.js.map +1 -0
  47. package/lib/commonjs/composites/wui-network-button/index.js +14 -10
  48. package/lib/commonjs/composites/wui-network-button/index.js.map +1 -1
  49. package/lib/commonjs/composites/wui-network-button/styles.js +3 -3
  50. package/lib/commonjs/composites/wui-network-button/styles.js.map +1 -1
  51. package/lib/commonjs/composites/wui-network-image/index.js +48 -21
  52. package/lib/commonjs/composites/wui-network-image/index.js.map +1 -1
  53. package/lib/commonjs/composites/wui-network-image/styles.js +3 -1
  54. package/lib/commonjs/composites/wui-network-image/styles.js.map +1 -1
  55. package/lib/commonjs/composites/wui-qr-code/index.js +26 -12
  56. package/lib/commonjs/composites/wui-qr-code/index.js.map +1 -1
  57. package/lib/commonjs/composites/wui-qr-code/styles.js +3 -0
  58. package/lib/commonjs/composites/wui-qr-code/styles.js.map +1 -1
  59. package/lib/commonjs/composites/wui-snackbar/index.js +1 -0
  60. package/lib/commonjs/composites/wui-snackbar/index.js.map +1 -1
  61. package/lib/commonjs/composites/wui-snackbar/styles.js +2 -1
  62. package/lib/commonjs/composites/wui-snackbar/styles.js.map +1 -1
  63. package/lib/commonjs/composites/wui-tabs/index.js +22 -8
  64. package/lib/commonjs/composites/wui-tabs/index.js.map +1 -1
  65. package/lib/commonjs/composites/wui-tabs/styles.js +1 -2
  66. package/lib/commonjs/composites/wui-tabs/styles.js.map +1 -1
  67. package/lib/commonjs/composites/wui-token-button/index.js +37 -0
  68. package/lib/commonjs/composites/wui-token-button/index.js.map +1 -0
  69. package/lib/commonjs/composites/wui-token-button/styles.js +24 -0
  70. package/lib/commonjs/composites/wui-token-button/styles.js.map +1 -0
  71. package/lib/commonjs/composites/wui-transaction-visual/index.js +73 -0
  72. package/lib/commonjs/composites/wui-transaction-visual/index.js.map +1 -0
  73. package/lib/commonjs/composites/wui-transaction-visual/styles.js +42 -0
  74. package/lib/commonjs/composites/wui-transaction-visual/styles.js.map +1 -0
  75. package/lib/commonjs/index.js +56 -0
  76. package/lib/commonjs/index.js.map +1 -1
  77. package/lib/commonjs/utils/ThemeUtil.js +2 -1
  78. package/lib/commonjs/utils/ThemeUtil.js.map +1 -1
  79. package/lib/commonjs/utils/TransactionUtil.js +139 -0
  80. package/lib/commonjs/utils/TransactionUtil.js.map +1 -0
  81. package/lib/commonjs/utils/UiUtil.js +15 -0
  82. package/lib/commonjs/utils/UiUtil.js.map +1 -1
  83. package/lib/module/assets/svg/ArrowBottomCircle.js +13 -0
  84. package/lib/module/assets/svg/ArrowBottomCircle.js.map +1 -0
  85. package/lib/module/assets/svg/Paperplane.js +13 -0
  86. package/lib/module/assets/svg/Paperplane.js.map +1 -0
  87. package/lib/module/components/wui-icon/index.js +4 -0
  88. package/lib/module/components/wui-icon/index.js.map +1 -1
  89. package/lib/module/composites/wui-account-button/index.js +13 -7
  90. package/lib/module/composites/wui-account-button/index.js.map +1 -1
  91. package/lib/module/composites/wui-account-button/styles.js +4 -4
  92. package/lib/module/composites/wui-account-button/styles.js.map +1 -1
  93. package/lib/module/composites/wui-account-pill/index.js +66 -0
  94. package/lib/module/composites/wui-account-pill/index.js.map +1 -0
  95. package/lib/module/composites/wui-account-pill/styles.js +19 -0
  96. package/lib/module/composites/wui-account-pill/styles.js.map +1 -0
  97. package/lib/module/composites/wui-avatar/styles.js +2 -1
  98. package/lib/module/composites/wui-avatar/styles.js.map +1 -1
  99. package/lib/module/composites/wui-balance/index.js +21 -0
  100. package/lib/module/composites/wui-balance/index.js.map +1 -0
  101. package/lib/module/composites/wui-banner/index.js +29 -0
  102. package/lib/module/composites/wui-banner/index.js.map +1 -0
  103. package/lib/module/composites/wui-banner/styles.js +15 -0
  104. package/lib/module/composites/wui-banner/styles.js.map +1 -0
  105. package/lib/module/composites/wui-button/index.js +3 -3
  106. package/lib/module/composites/wui-button/index.js.map +1 -1
  107. package/lib/module/composites/wui-button/styles.js +2 -2
  108. package/lib/module/composites/wui-button/styles.js.map +1 -1
  109. package/lib/module/composites/wui-chip/index.js +6 -8
  110. package/lib/module/composites/wui-chip/index.js.map +1 -1
  111. package/lib/module/composites/wui-chip/styles.js +1 -1
  112. package/lib/module/composites/wui-chip/styles.js.map +1 -1
  113. package/lib/module/composites/wui-compatible-network/index.js +52 -0
  114. package/lib/module/composites/wui-compatible-network/index.js.map +1 -0
  115. package/lib/module/composites/wui-list-item/index.js +10 -10
  116. package/lib/module/composites/wui-list-item/index.js.map +1 -1
  117. package/lib/module/composites/wui-list-item/styles.js +4 -3
  118. package/lib/module/composites/wui-list-item/styles.js.map +1 -1
  119. package/lib/module/composites/wui-list-token/index.js +71 -0
  120. package/lib/module/composites/wui-list-token/index.js.map +1 -0
  121. package/lib/module/composites/wui-list-token/styles.js +24 -0
  122. package/lib/module/composites/wui-list-token/styles.js.map +1 -0
  123. package/lib/module/composites/wui-list-transaction/index.js +57 -0
  124. package/lib/module/composites/wui-list-transaction/index.js.map +1 -0
  125. package/lib/module/composites/wui-list-transaction/styles.js +10 -0
  126. package/lib/module/composites/wui-list-transaction/styles.js.map +1 -0
  127. package/lib/module/composites/wui-list-transaction/utils.js +79 -0
  128. package/lib/module/composites/wui-list-transaction/utils.js.map +1 -0
  129. package/lib/module/composites/wui-network-button/index.js +15 -11
  130. package/lib/module/composites/wui-network-button/index.js.map +1 -1
  131. package/lib/module/composites/wui-network-button/styles.js +4 -4
  132. package/lib/module/composites/wui-network-button/styles.js.map +1 -1
  133. package/lib/module/composites/wui-network-image/index.js +49 -22
  134. package/lib/module/composites/wui-network-image/index.js.map +1 -1
  135. package/lib/module/composites/wui-network-image/styles.js +2 -0
  136. package/lib/module/composites/wui-network-image/styles.js.map +1 -1
  137. package/lib/module/composites/wui-qr-code/index.js +26 -12
  138. package/lib/module/composites/wui-qr-code/index.js.map +1 -1
  139. package/lib/module/composites/wui-qr-code/styles.js +3 -0
  140. package/lib/module/composites/wui-qr-code/styles.js.map +1 -1
  141. package/lib/module/composites/wui-snackbar/index.js +1 -0
  142. package/lib/module/composites/wui-snackbar/index.js.map +1 -1
  143. package/lib/module/composites/wui-snackbar/styles.js +2 -1
  144. package/lib/module/composites/wui-snackbar/styles.js.map +1 -1
  145. package/lib/module/composites/wui-tabs/index.js +22 -8
  146. package/lib/module/composites/wui-tabs/index.js.map +1 -1
  147. package/lib/module/composites/wui-tabs/styles.js +1 -2
  148. package/lib/module/composites/wui-tabs/styles.js.map +1 -1
  149. package/lib/module/composites/wui-token-button/index.js +30 -0
  150. package/lib/module/composites/wui-token-button/index.js.map +1 -0
  151. package/lib/module/composites/wui-token-button/styles.js +18 -0
  152. package/lib/module/composites/wui-token-button/styles.js.map +1 -0
  153. package/lib/module/composites/wui-transaction-visual/index.js +66 -0
  154. package/lib/module/composites/wui-transaction-visual/index.js.map +1 -0
  155. package/lib/module/composites/wui-transaction-visual/styles.js +36 -0
  156. package/lib/module/composites/wui-transaction-visual/styles.js.map +1 -0
  157. package/lib/module/index.js +8 -0
  158. package/lib/module/index.js.map +1 -1
  159. package/lib/module/utils/ThemeUtil.js +2 -1
  160. package/lib/module/utils/ThemeUtil.js.map +1 -1
  161. package/lib/module/utils/TransactionUtil.js +134 -0
  162. package/lib/module/utils/TransactionUtil.js.map +1 -0
  163. package/lib/module/utils/UiUtil.js +15 -0
  164. package/lib/module/utils/UiUtil.js.map +1 -1
  165. package/lib/typescript/assets/svg/ArrowBottomCircle.d.ts +4 -0
  166. package/lib/typescript/assets/svg/ArrowBottomCircle.d.ts.map +1 -0
  167. package/lib/typescript/assets/svg/Paperplane.d.ts +4 -0
  168. package/lib/typescript/assets/svg/Paperplane.d.ts.map +1 -0
  169. package/lib/typescript/components/wui-icon/index.d.ts.map +1 -1
  170. package/lib/typescript/composites/wui-account-button/index.d.ts +2 -2
  171. package/lib/typescript/composites/wui-account-button/index.d.ts.map +1 -1
  172. package/lib/typescript/composites/wui-account-pill/index.d.ts +11 -0
  173. package/lib/typescript/composites/wui-account-pill/index.d.ts.map +1 -0
  174. package/lib/typescript/composites/wui-account-pill/styles.d.ts +18 -0
  175. package/lib/typescript/composites/wui-account-pill/styles.d.ts.map +1 -0
  176. package/lib/typescript/composites/wui-avatar/styles.d.ts.map +1 -1
  177. package/lib/typescript/composites/wui-balance/index.d.ts +6 -0
  178. package/lib/typescript/composites/wui-balance/index.d.ts.map +1 -0
  179. package/lib/typescript/composites/wui-banner/index.d.ts +7 -0
  180. package/lib/typescript/composites/wui-banner/index.d.ts.map +1 -0
  181. package/lib/typescript/composites/wui-banner/styles.d.ts +14 -0
  182. package/lib/typescript/composites/wui-banner/styles.d.ts.map +1 -0
  183. package/lib/typescript/composites/wui-button/index.d.ts.map +1 -1
  184. package/lib/typescript/composites/wui-chip/index.d.ts +2 -2
  185. package/lib/typescript/composites/wui-chip/index.d.ts.map +1 -1
  186. package/lib/typescript/composites/wui-compatible-network/index.d.ts +10 -0
  187. package/lib/typescript/composites/wui-compatible-network/index.d.ts.map +1 -0
  188. package/lib/typescript/composites/wui-list-item/index.d.ts +6 -4
  189. package/lib/typescript/composites/wui-list-item/index.d.ts.map +1 -1
  190. package/lib/typescript/composites/wui-list-item/styles.d.ts +1 -0
  191. package/lib/typescript/composites/wui-list-item/styles.d.ts.map +1 -1
  192. package/lib/typescript/composites/wui-list-token/index.d.ts +11 -0
  193. package/lib/typescript/composites/wui-list-token/index.d.ts.map +1 -0
  194. package/lib/typescript/composites/wui-list-token/styles.d.ts +23 -0
  195. package/lib/typescript/composites/wui-list-token/styles.d.ts.map +1 -0
  196. package/lib/typescript/composites/wui-list-transaction/index.d.ts +15 -0
  197. package/lib/typescript/composites/wui-list-transaction/index.d.ts.map +1 -0
  198. package/lib/typescript/composites/wui-list-transaction/styles.d.ts +10 -0
  199. package/lib/typescript/composites/wui-list-transaction/styles.d.ts.map +1 -0
  200. package/lib/typescript/composites/wui-list-transaction/utils.d.ts +6 -0
  201. package/lib/typescript/composites/wui-list-transaction/utils.d.ts.map +1 -0
  202. package/lib/typescript/composites/wui-network-button/index.d.ts +6 -4
  203. package/lib/typescript/composites/wui-network-button/index.d.ts.map +1 -1
  204. package/lib/typescript/composites/wui-network-button/styles.d.ts +1 -1
  205. package/lib/typescript/composites/wui-network-image/index.d.ts +6 -2
  206. package/lib/typescript/composites/wui-network-image/index.d.ts.map +1 -1
  207. package/lib/typescript/composites/wui-network-image/styles.d.ts +2 -0
  208. package/lib/typescript/composites/wui-network-image/styles.d.ts.map +1 -1
  209. package/lib/typescript/composites/wui-qr-code/index.d.ts +4 -1
  210. package/lib/typescript/composites/wui-qr-code/index.d.ts.map +1 -1
  211. package/lib/typescript/composites/wui-qr-code/styles.d.ts +3 -0
  212. package/lib/typescript/composites/wui-qr-code/styles.d.ts.map +1 -1
  213. package/lib/typescript/composites/wui-snackbar/index.d.ts.map +1 -1
  214. package/lib/typescript/composites/wui-snackbar/styles.d.ts.map +1 -1
  215. package/lib/typescript/composites/wui-tabs/index.d.ts +4 -2
  216. package/lib/typescript/composites/wui-tabs/index.d.ts.map +1 -1
  217. package/lib/typescript/composites/wui-tabs/styles.d.ts +1 -2
  218. package/lib/typescript/composites/wui-tabs/styles.d.ts.map +1 -1
  219. package/lib/typescript/composites/wui-token-button/index.d.ts +7 -0
  220. package/lib/typescript/composites/wui-token-button/index.d.ts.map +1 -0
  221. package/lib/typescript/composites/wui-token-button/styles.d.ts +17 -0
  222. package/lib/typescript/composites/wui-token-button/styles.d.ts.map +1 -0
  223. package/lib/typescript/composites/wui-transaction-visual/index.d.ts +8 -0
  224. package/lib/typescript/composites/wui-transaction-visual/index.d.ts.map +1 -0
  225. package/lib/typescript/composites/wui-transaction-visual/styles.d.ts +35 -0
  226. package/lib/typescript/composites/wui-transaction-visual/styles.d.ts.map +1 -0
  227. package/lib/typescript/index.d.ts +8 -0
  228. package/lib/typescript/index.d.ts.map +1 -1
  229. package/lib/typescript/utils/ThemeUtil.d.ts +1 -0
  230. package/lib/typescript/utils/ThemeUtil.d.ts.map +1 -1
  231. package/lib/typescript/utils/TransactionUtil.d.ts +13 -0
  232. package/lib/typescript/utils/TransactionUtil.d.ts.map +1 -0
  233. package/lib/typescript/utils/TypesUtil.d.ts +4 -3
  234. package/lib/typescript/utils/TypesUtil.d.ts.map +1 -1
  235. package/lib/typescript/utils/UiUtil.d.ts +1 -0
  236. package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
  237. package/package.json +6 -6
  238. package/readme.md +9 -0
  239. package/src/assets/svg/ArrowBottomCircle.tsx +12 -0
  240. package/src/assets/svg/Paperplane.tsx +12 -0
  241. package/src/components/wui-icon/index.tsx +4 -0
  242. package/src/composites/wui-account-button/index.tsx +17 -8
  243. package/src/composites/wui-account-button/styles.ts +4 -4
  244. package/src/composites/wui-account-pill/index.tsx +72 -0
  245. package/src/composites/wui-account-pill/styles.ts +19 -0
  246. package/src/composites/wui-avatar/styles.ts +2 -1
  247. package/src/composites/wui-balance/index.tsx +25 -0
  248. package/src/composites/wui-banner/index.tsx +28 -0
  249. package/src/composites/wui-banner/styles.ts +15 -0
  250. package/src/composites/wui-button/index.tsx +12 -10
  251. package/src/composites/wui-button/styles.ts +2 -2
  252. package/src/composites/wui-chip/index.tsx +7 -9
  253. package/src/composites/wui-chip/styles.ts +1 -1
  254. package/src/composites/wui-compatible-network/index.tsx +64 -0
  255. package/src/composites/wui-list-item/index.tsx +15 -14
  256. package/src/composites/wui-list-item/styles.ts +4 -3
  257. package/src/composites/wui-list-token/index.tsx +83 -0
  258. package/src/composites/wui-list-token/styles.ts +24 -0
  259. package/src/composites/wui-list-transaction/index.tsx +65 -0
  260. package/src/composites/wui-list-transaction/styles.ts +10 -0
  261. package/src/composites/wui-list-transaction/utils.ts +83 -0
  262. package/src/composites/wui-network-button/index.tsx +22 -15
  263. package/src/composites/wui-network-button/styles.ts +4 -4
  264. package/src/composites/wui-network-image/index.tsx +57 -21
  265. package/src/composites/wui-network-image/styles.ts +6 -0
  266. package/src/composites/wui-qr-code/index.tsx +29 -14
  267. package/src/composites/wui-qr-code/styles.ts +3 -0
  268. package/src/composites/wui-snackbar/index.tsx +1 -0
  269. package/src/composites/wui-snackbar/styles.ts +2 -1
  270. package/src/composites/wui-tabs/index.tsx +33 -9
  271. package/src/composites/wui-tabs/styles.ts +1 -2
  272. package/src/composites/wui-token-button/index.tsx +29 -0
  273. package/src/composites/wui-token-button/styles.ts +18 -0
  274. package/src/composites/wui-transaction-visual/index.tsx +78 -0
  275. package/src/composites/wui-transaction-visual/styles.ts +36 -0
  276. package/src/index.ts +11 -0
  277. package/src/utils/ThemeUtil.ts +2 -1
  278. package/src/utils/TransactionUtil.ts +173 -0
  279. package/src/utils/TypesUtil.ts +36 -2
  280. package/src/utils/UiUtil.ts +18 -0
@@ -68,7 +68,7 @@ export default StyleSheet.create({
68
68
  borderWidth: 1
69
69
  },
70
70
  image: {
71
- borderRadius: 100,
71
+ borderRadius: BorderRadius.full,
72
72
  borderWidth: 1
73
73
  },
74
74
  smImage: {
@@ -0,0 +1,64 @@
1
+ import { Text } from '../../components/wui-text';
2
+ import { NetworkImage } from '../wui-network-image';
3
+ import { FlexView } from '../../layout/wui-flex';
4
+ import { ListItem } from '../wui-list-item';
5
+ import { StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
6
+ import { useTheme } from '../../hooks/useTheme';
7
+
8
+ export interface CompatibleNetworkProps {
9
+ text: string;
10
+ onPress: () => void;
11
+ networkImages: string[];
12
+ imageHeaders: Record<string, string>;
13
+ style?: StyleProp<ViewStyle>;
14
+ }
15
+
16
+ const offset = [20, 15, 10, 5, 0];
17
+ const zIndex = [5, 4, 3, 2, 1];
18
+
19
+ export function CompatibleNetwork({
20
+ text,
21
+ onPress,
22
+ networkImages,
23
+ imageHeaders,
24
+ style
25
+ }: CompatibleNetworkProps) {
26
+ const Theme = useTheme();
27
+
28
+ return (
29
+ <ListItem
30
+ onPress={onPress}
31
+ style={[styles.container, style]}
32
+ contentStyle={styles.contentContainer}
33
+ chevron
34
+ >
35
+ <Text color="fg-200" variant="small-400">
36
+ {text}
37
+ </Text>
38
+ <FlexView flexDirection="row" justifyContent="center" alignItems="center">
39
+ {networkImages?.map((image, index) => (
40
+ <NetworkImage
41
+ size="xs"
42
+ key={image}
43
+ imageSrc={image}
44
+ imageHeaders={imageHeaders}
45
+ borderColor={Theme['bg-200']}
46
+ borderWidth={2}
47
+ style={{ left: offset[index], zIndex: zIndex[index] }}
48
+ />
49
+ ))}
50
+ </FlexView>
51
+ </ListItem>
52
+ );
53
+ }
54
+
55
+ const styles = StyleSheet.create({
56
+ container: {
57
+ height: 48
58
+ },
59
+ contentContainer: {
60
+ flexDirection: 'row',
61
+ justifyContent: 'space-between',
62
+ paddingRight: 0
63
+ }
64
+ });
@@ -5,7 +5,7 @@ import { Image } from '../../components/wui-image';
5
5
  import { LoadingSpinner } from '../../components/wui-loading-spinner';
6
6
  import useAnimatedValue from '../../hooks/useAnimatedValue';
7
7
  import { useTheme } from '../../hooks/useTheme';
8
- import type { IconType } from '../../utils/TypesUtil';
8
+ import type { ColorType, IconType } from '../../utils/TypesUtil';
9
9
  import { IconBox } from '../wui-icon-box';
10
10
  import styles from './styles';
11
11
 
@@ -13,8 +13,9 @@ const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
13
13
 
14
14
  export interface ListItemProps {
15
15
  icon?: IconType;
16
- iconVariant?: 'blue' | 'overlay';
17
- variant?: 'image' | 'icon';
16
+ iconColor?: ColorType;
17
+ iconBackgroundColor?: ColorType;
18
+ iconBorderColor?: ColorType;
18
19
  imageSrc?: string;
19
20
  imageHeaders?: Record<string, string>;
20
21
  chevron?: boolean;
@@ -23,21 +24,24 @@ export interface ListItemProps {
23
24
  onPress?: () => void;
24
25
  children?: ReactNode;
25
26
  style?: StyleProp<ViewStyle>;
27
+ contentStyle?: StyleProp<ViewStyle>;
26
28
  testID?: string;
27
29
  }
28
30
 
29
31
  export function ListItem({
30
32
  children,
31
33
  icon,
32
- variant,
33
34
  imageSrc,
34
35
  imageHeaders,
35
- iconVariant = 'blue',
36
+ iconColor = 'fg-200',
37
+ iconBackgroundColor,
38
+ iconBorderColor = 'gray-glass-005',
36
39
  chevron,
37
40
  loading,
38
41
  disabled,
39
42
  onPress,
40
43
  style,
44
+ contentStyle,
41
45
  testID
42
46
  }: ListItemProps) {
43
47
  const Theme = useTheme();
@@ -47,7 +51,7 @@ export function ListItem({
47
51
  );
48
52
 
49
53
  function visualTemplate() {
50
- if (variant === 'image' && imageSrc) {
54
+ if (imageSrc) {
51
55
  return (
52
56
  <View style={[styles.imageContainer, { borderColor: Theme['gray-glass-005'] }]}>
53
57
  <Image
@@ -57,18 +61,15 @@ export function ListItem({
57
61
  />
58
62
  </View>
59
63
  );
60
- } else if (variant === 'icon' && icon) {
61
- const iconColor = iconVariant === 'blue' ? 'accent-100' : 'fg-200';
62
- const borderColor = iconVariant === 'blue' ? 'accent-glass-005' : 'gray-glass-005';
63
-
64
+ } else if (icon) {
64
65
  return (
65
- <View style={[styles.imageContainer, { borderColor: Theme[borderColor] }]}>
66
+ <View style={[styles.imageContainer, { borderColor: Theme[iconBorderColor] }]}>
66
67
  <IconBox
67
68
  icon={icon}
68
69
  iconColor={iconColor}
69
70
  size="md"
70
71
  background
71
- backgroundColor="gray-glass-010"
72
+ backgroundColor={iconBackgroundColor}
72
73
  />
73
74
  </View>
74
75
  );
@@ -81,7 +82,7 @@ export function ListItem({
81
82
  if (loading) {
82
83
  return <LoadingSpinner color="fg-200" size="lg" style={styles.rightIcon} />;
83
84
  } else if (chevron) {
84
- return <Icon name="chevronRight" size="md" color="fg-150" style={styles.rightIcon} />;
85
+ return <Icon name="chevronRight" size="md" color="fg-200" style={styles.rightIcon} />;
85
86
  }
86
87
 
87
88
  return null;
@@ -101,7 +102,7 @@ export function ListItem({
101
102
  testID={testID}
102
103
  >
103
104
  {visualTemplate()}
104
- <View style={styles.content}>{children}</View>
105
+ <View style={[styles.content, contentStyle]}>{children}</View>
105
106
  {rightTemplate()}
106
107
  </AnimatedPressable>
107
108
  );
@@ -13,12 +13,13 @@ export default StyleSheet.create({
13
13
  content: {
14
14
  flexDirection: 'row',
15
15
  flexGrow: 1,
16
- paddingHorizontal: Spacing.s
16
+ paddingHorizontal: Spacing.s,
17
+ alignItems: 'center'
17
18
  },
18
19
  imageContainer: {
19
20
  width: 36,
20
21
  height: 36,
21
- borderRadius: 100,
22
+ borderRadius: BorderRadius.full,
22
23
  borderWidth: 2,
23
24
  alignItems: 'center',
24
25
  justifyContent: 'center'
@@ -26,7 +27,7 @@ export default StyleSheet.create({
26
27
  image: {
27
28
  width: 32,
28
29
  height: 32,
29
- borderRadius: 100
30
+ borderRadius: BorderRadius.full
30
31
  },
31
32
  disabledImage: {
32
33
  opacity: 0.4
@@ -0,0 +1,83 @@
1
+ import { Pressable } from 'react-native';
2
+ import { Icon } from '../../components/wui-icon';
3
+ import { Image } from '../../components/wui-image';
4
+ import { Text } from '../../components/wui-text';
5
+ import { useTheme } from '../../hooks/useTheme';
6
+ import { FlexView } from '../../layout/wui-flex';
7
+ import { UiUtil } from '../../utils/UiUtil';
8
+ import styles from './styles';
9
+
10
+ export interface ListTokenProps {
11
+ imageSrc: string;
12
+ networkSrc?: string;
13
+ name: string;
14
+ value?: number;
15
+ amount?: string;
16
+ currency: string;
17
+ onPress?: () => void;
18
+ }
19
+
20
+ export function ListToken({
21
+ imageSrc,
22
+ networkSrc,
23
+ name,
24
+ value,
25
+ amount,
26
+ currency,
27
+ onPress
28
+ }: ListTokenProps) {
29
+ const Theme = useTheme();
30
+
31
+ return (
32
+ <Pressable onPress={onPress}>
33
+ <FlexView
34
+ flexDirection="row"
35
+ justifyContent="space-between"
36
+ alignItems="center"
37
+ padding={['2xs', 'm', '2xs', 'xs']}
38
+ >
39
+ <FlexView flexDirection="row" alignItems="center">
40
+ {imageSrc ? (
41
+ <Image
42
+ source={imageSrc}
43
+ style={[styles.image, { backgroundColor: Theme['gray-glass-005'] }]}
44
+ />
45
+ ) : (
46
+ <FlexView
47
+ style={[styles.image, { backgroundColor: Theme['gray-glass-005'] }]}
48
+ alignItems="center"
49
+ justifyContent="center"
50
+ >
51
+ <Icon name="coinPlaceholder" size="lg" color="fg-200" />
52
+ </FlexView>
53
+ )}
54
+ <FlexView
55
+ alignItems="center"
56
+ justifyContent="center"
57
+ style={[
58
+ styles.networkImageContainer,
59
+ { borderColor: Theme['bg-100'], backgroundColor: Theme['bg-200'] }
60
+ ]}
61
+ >
62
+ {networkSrc ? (
63
+ <Image source={networkSrc} style={styles.networkImage} />
64
+ ) : (
65
+ <Icon name="networkPlaceholder" size="xxs" color="fg-200" />
66
+ )}
67
+ </FlexView>
68
+ <FlexView padding={['0', 's', '0', 's']}>
69
+ <Text color="fg-100" variant="paragraph-500">
70
+ {name}
71
+ </Text>
72
+ <Text variant="small-400" color="fg-200">
73
+ {UiUtil.formatNumberToLocalString(amount, 4)} {currency}
74
+ </Text>
75
+ </FlexView>
76
+ </FlexView>
77
+ <Text color="fg-100" variant="paragraph-500">
78
+ ${value?.toFixed(2) ?? '0.00'}
79
+ </Text>
80
+ </FlexView>
81
+ </Pressable>
82
+ );
83
+ }
@@ -0,0 +1,24 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import { BorderRadius, WalletImageSize } from '../../utils/ThemeUtil';
3
+
4
+ export default StyleSheet.create({
5
+ image: {
6
+ height: WalletImageSize.sm,
7
+ width: WalletImageSize.sm,
8
+ borderRadius: BorderRadius.full
9
+ },
10
+ networkImageContainer: {
11
+ position: 'absolute',
12
+ bottom: -2,
13
+ left: 24,
14
+ borderWidth: 2,
15
+ borderRadius: BorderRadius.full,
16
+ width: 18,
17
+ height: 18
18
+ },
19
+ networkImage: {
20
+ width: 14,
21
+ height: 14,
22
+ borderRadius: BorderRadius.full
23
+ }
24
+ });
@@ -0,0 +1,65 @@
1
+ import { type TransactionImage, type TransactionStatus } from '@reown/appkit-common-react-native';
2
+
3
+ import type { TransactionType } from '../../utils/TypesUtil';
4
+ import { Text } from '../../components/wui-text';
5
+ import { FlexView } from '../../layout/wui-flex';
6
+ import { IconBox } from '../wui-icon-box';
7
+ import { TransactionVisual } from '../wui-transaction-visual';
8
+ import { getIcon, getTypeLabel, getIconColor } from './utils';
9
+ import styles from './styles';
10
+ import type { StyleProp, ViewStyle } from 'react-native';
11
+
12
+ export interface ListTransactionProps {
13
+ date: string;
14
+ status?: TransactionStatus;
15
+ type?: TransactionType;
16
+ descriptions?: string[];
17
+ images?: TransactionImage[];
18
+ networkSrc?: string;
19
+ style?: StyleProp<ViewStyle>;
20
+ isAllNFT?: boolean;
21
+ }
22
+
23
+ export function ListTransaction({
24
+ date,
25
+ type,
26
+ descriptions,
27
+ images,
28
+ networkSrc,
29
+ style,
30
+ isAllNFT,
31
+ status
32
+ }: ListTransactionProps) {
33
+ const joinSymbol = type === 'trade' ? ' → ' : ' - ';
34
+
35
+ return (
36
+ <FlexView flexDirection="row" alignItems="center" style={style}>
37
+ <TransactionVisual images={images} networkSrc={networkSrc} isAllNFT={isAllNFT} />
38
+ <FlexView flexDirection="row" alignItems="center" style={styles.middleContainer}>
39
+ <FlexView justifyContent="center" alignItems="flex-start">
40
+ <FlexView flexDirection="row" alignItems="center">
41
+ {type && (
42
+ <IconBox
43
+ icon={getIcon(type)}
44
+ size="sm"
45
+ iconColor={getIconColor(status)}
46
+ background
47
+ border
48
+ borderColor="bg-100"
49
+ />
50
+ )}
51
+ <Text variant="paragraph-500" color="fg-100">
52
+ {getTypeLabel(type)}
53
+ </Text>
54
+ </FlexView>
55
+ <Text variant="small-400" color="fg-200" numberOfLines={1} ellipsizeMode="tail">
56
+ {descriptions?.join(joinSymbol)}
57
+ </Text>
58
+ </FlexView>
59
+ </FlexView>
60
+ <Text variant="micro-700" color="fg-300" style={styles.date}>
61
+ {date}
62
+ </Text>
63
+ </FlexView>
64
+ );
65
+ }
@@ -0,0 +1,10 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export default StyleSheet.create({
4
+ middleContainer: {
5
+ flex: 1
6
+ },
7
+ date: {
8
+ textTransform: 'uppercase'
9
+ }
10
+ });
@@ -0,0 +1,83 @@
1
+ import type { TransactionStatus } from '@reown/appkit-common-react-native';
2
+ import type { IconType, TransactionType } from '../../utils/TypesUtil';
3
+
4
+ export const getIcon = (type: TransactionType): IconType => {
5
+ switch (type) {
6
+ case 'approve':
7
+ case 'execute':
8
+ return 'checkmark';
9
+ case 'repay':
10
+ case 'send':
11
+ case 'stake':
12
+ case 'withdraw':
13
+ return 'arrowTop';
14
+ case 'burn':
15
+ case 'cancel':
16
+ return 'close';
17
+ case 'trade':
18
+ return 'swapHorizontal';
19
+ case 'deploy':
20
+ return 'arrowRight';
21
+ default:
22
+ return 'arrowBottom';
23
+ }
24
+ };
25
+
26
+ //Utils
27
+ export const getIconColor = (status?: TransactionStatus) => {
28
+ switch (status) {
29
+ case 'confirmed':
30
+ return 'success-100';
31
+ case 'failed':
32
+ return 'error-100';
33
+ case 'pending':
34
+ return 'fg-200';
35
+ default:
36
+ return 'fg-200';
37
+ }
38
+ };
39
+
40
+ export const getTypeLabel = (type?: TransactionType) => {
41
+ if (!type) {
42
+ return 'Unknown';
43
+ }
44
+
45
+ switch (type) {
46
+ case 'approve':
47
+ return 'Approved';
48
+ case 'bought':
49
+ return 'Bought';
50
+ case 'borrow':
51
+ return 'Borrowed';
52
+ case 'burn':
53
+ return 'Burnt';
54
+ case 'cancel':
55
+ return 'Canceled';
56
+ case 'claim':
57
+ return 'Claimed';
58
+ case 'deploy':
59
+ return 'Deployed';
60
+ case 'deposit':
61
+ return 'Deposited';
62
+ case 'execute':
63
+ return 'Executed';
64
+ case 'mint':
65
+ return 'Minted';
66
+ case 'receive':
67
+ return 'Received';
68
+ case 'repay':
69
+ return 'Repaid';
70
+ case 'send':
71
+ return 'Sent';
72
+ case 'stake':
73
+ return 'Staked';
74
+ case 'trade':
75
+ return 'Swapped';
76
+ case 'unstake':
77
+ return 'Unstaked';
78
+ case 'withdraw':
79
+ return 'Withdrawn';
80
+ default:
81
+ return 'Unknown';
82
+ }
83
+ };
@@ -1,47 +1,50 @@
1
- import { Animated, Pressable, type StyleProp, type ViewStyle } from 'react-native';
1
+ import { Animated, Pressable, View, type StyleProp, type ViewStyle } from 'react-native';
2
2
  import { Image } from '../../components/wui-image';
3
3
  import { Text } from '../../components/wui-text';
4
4
  import { useTheme } from '../../hooks/useTheme';
5
5
  import { IconBox } from '../wui-icon-box';
6
+ import { LoadingSpinner } from '../../components/wui-loading-spinner';
7
+ import useAnimatedValue from '../../hooks/useAnimatedValue';
6
8
 
7
9
  import styles from './styles';
8
- import useAnimatedValue from '../../hooks/useAnimatedValue';
9
- import { LoadingSpinner } from '../../components/wui-loading-spinner';
10
10
 
11
11
  const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
12
12
 
13
13
  export interface NetworkButtonProps {
14
- children: string;
14
+ children: string | React.ReactNode;
15
15
  onPress: () => void;
16
+ background?: boolean;
17
+ disabled?: boolean;
16
18
  imageSrc?: string;
17
19
  imageHeaders?: Record<string, string>;
18
- disabled?: boolean;
19
- style?: StyleProp<ViewStyle>;
20
20
  loading?: boolean;
21
+ style?: StyleProp<ViewStyle>;
21
22
  }
22
23
 
23
24
  export function NetworkButton({
25
+ children,
26
+ onPress,
27
+ background = true,
28
+ disabled,
24
29
  imageSrc,
25
30
  imageHeaders,
26
- disabled,
27
- onPress,
28
- style,
29
31
  loading,
30
- children
32
+ style
31
33
  }: NetworkButtonProps) {
32
34
  const Theme = useTheme();
33
35
  const textColor = disabled ? 'fg-300' : 'fg-100';
34
36
 
35
37
  const { animatedValue, setStartValue, setEndValue } = useAnimatedValue(
36
- Theme['gray-glass-005'],
38
+ background ? Theme['gray-glass-005'] : 'transparent',
37
39
  Theme['gray-glass-010']
38
40
  );
39
41
 
40
42
  const backgroundColor = disabled ? Theme['gray-glass-015'] : animatedValue;
43
+ const borderColor = background ? Theme['gray-glass-005'] : 'transparent';
41
44
 
42
45
  return (
43
46
  <AnimatedPressable
44
- style={[styles.container, { backgroundColor, borderColor: Theme['gray-glass-005'] }, style]}
47
+ style={[styles.container, { backgroundColor, borderColor }, style]}
45
48
  onPress={onPress}
46
49
  onPressIn={setEndValue}
47
50
  onPressOut={setStartValue}
@@ -55,9 +58,13 @@ export function NetworkButton({
55
58
  imageHeaders={imageHeaders}
56
59
  borderColor={Theme['gray-glass-005']}
57
60
  />
58
- <Text style={styles.text} variant="paragraph-600" color={textColor}>
59
- {children}
60
- </Text>
61
+ {typeof children === 'string' ? (
62
+ <Text style={styles.children} variant="paragraph-600" color={textColor}>
63
+ {children}
64
+ </Text>
65
+ ) : (
66
+ <View style={styles.children}>{children}</View>
67
+ )}
61
68
  </AnimatedPressable>
62
69
  );
63
70
  }
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from 'react-native';
2
- import { Spacing } from '../../utils/ThemeUtil';
2
+ import { BorderRadius, Spacing } from '../../utils/ThemeUtil';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  container: {
@@ -8,10 +8,10 @@ export default StyleSheet.create({
8
8
  alignItems: 'center',
9
9
  justifyContent: 'center',
10
10
  borderWidth: 1,
11
- borderRadius: 100,
11
+ borderRadius: BorderRadius.full,
12
12
  paddingHorizontal: Spacing['2xs']
13
13
  },
14
- text: {
14
+ children: {
15
15
  paddingHorizontal: Spacing['2xs']
16
16
  },
17
17
  loader: {
@@ -20,7 +20,7 @@ export default StyleSheet.create({
20
20
  image: {
21
21
  height: 24,
22
22
  width: 24,
23
- borderRadius: 100,
23
+ borderRadius: BorderRadius.full,
24
24
  borderWidth: 2,
25
25
  paddingLeft: Spacing['4xs']
26
26
  },
@@ -1,49 +1,85 @@
1
1
  import { Path, Svg, Image, Defs, Pattern } from 'react-native-svg';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
2
3
  import { useTheme } from '../../hooks/useTheme';
3
4
  import type { SizeType } from '../../utils/TypesUtil';
4
- import { PathLg, PathNormal } from './styles';
5
+ import { Icon } from '../../components/wui-icon';
6
+ import { FlexView } from '../../layout/wui-flex';
7
+ import { PathLg, PathNormal, PathSmall, PathXS } from './styles';
5
8
 
6
9
  export interface NetworkImageProps {
7
10
  imageSrc?: string;
8
11
  imageHeaders?: Record<string, string>;
9
12
  selected?: boolean;
10
- size?: Exclude<SizeType, 'xl' | 'sm' | 'xs' | 'xxs'>;
13
+ size?: Exclude<SizeType, 'xl' | 'xxs'>;
11
14
  disabled?: boolean;
15
+ style?: StyleProp<ViewStyle>;
16
+ borderColor?: string;
17
+ borderWidth?: number;
12
18
  }
13
19
 
20
+ const sizeToPath = {
21
+ lg: PathLg,
22
+ md: PathNormal,
23
+ sm: PathSmall,
24
+ xs: PathXS
25
+ };
26
+
27
+ const sizeToHeight = {
28
+ lg: 96,
29
+ md: 56,
30
+ sm: 40,
31
+ xs: 20
32
+ };
33
+
14
34
  export function NetworkImage({
15
35
  imageSrc,
16
36
  imageHeaders,
17
37
  disabled,
18
38
  selected,
19
- size = 'md'
39
+ size = 'md',
40
+ style,
41
+ borderColor,
42
+ borderWidth = 1
20
43
  }: NetworkImageProps) {
21
44
  const Theme = useTheme();
22
- const isLg = size === 'lg';
23
- const svgWidth = isLg ? 96 : 56;
24
- const svgHeight = isLg ? 96 : 56;
25
45
  const svgStroke = selected ? Theme['accent-100'] : Theme['gray-glass-010'];
26
46
  const opacity = disabled ? 0.5 : 1;
27
47
 
28
48
  return (
29
- <Svg width={svgWidth} height={svgHeight} stroke={svgStroke} strokeWidth={1}>
49
+ <Svg
50
+ width={sizeToHeight[size]}
51
+ height={sizeToHeight[size]}
52
+ stroke={borderColor ?? svgStroke}
53
+ strokeWidth={borderWidth}
54
+ style={style}
55
+ >
30
56
  <Defs>
31
- <Pattern id="image-pattern" x="0" y="0" width="1" height="1">
32
- <Image
33
- height={svgHeight}
34
- width={svgWidth}
35
- x="0"
36
- y="0"
37
- opacity={opacity}
38
- href={{ uri: imageSrc, headers: imageHeaders }}
39
- />
57
+ <Pattern id="image-pattern">
58
+ {imageSrc ? (
59
+ <Image
60
+ height={sizeToHeight[size]}
61
+ width={sizeToHeight[size]}
62
+ opacity={opacity}
63
+ href={{ uri: imageSrc, headers: imageHeaders }}
64
+ />
65
+ ) : (
66
+ <FlexView
67
+ alignItems="center"
68
+ justifyContent="center"
69
+ // eslint-disable-next-line react-native/no-inline-styles
70
+ style={{
71
+ height: sizeToHeight[size],
72
+ width: sizeToHeight[size],
73
+ backgroundColor: 'transparent'
74
+ }}
75
+ >
76
+ <Icon name="networkPlaceholder" size={size} color="fg-200" />
77
+ </FlexView>
78
+ )}
40
79
  </Pattern>
41
80
  </Defs>
42
- <Path
43
- d={`${isLg ? PathLg : PathNormal}`}
44
- opacity={opacity}
45
- fill={imageSrc ? 'url(#image-pattern)' : Theme['gray-glass-005']}
46
- />
81
+ {!imageSrc && <Path d={sizeToPath[size]} opacity={opacity} fill={Theme['gray-glass-005']} />}
82
+ <Path d={sizeToPath[size]} opacity={opacity} fill="url(#image-pattern)" />
47
83
  </Svg>
48
84
  );
49
85
  }