@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.31

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 (331) hide show
  1. package/dist/QueueManager.d.ts +5 -2
  2. package/dist/QueueManager.d.ts.map +1 -1
  3. package/dist/components/AppRouter.d.ts +0 -2
  4. package/dist/components/AppRouter.d.ts.map +1 -1
  5. package/dist/components/AppRoutes.d.ts +1 -6
  6. package/dist/components/AppRoutes.d.ts.map +1 -1
  7. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +370 -56
  8. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
  11. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  13. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
  14. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  15. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
  16. package/dist/components/Layout/Layout.d.ts.map +1 -1
  17. package/dist/components/Layout/Layout.types.d.ts +2 -2
  18. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  19. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
  20. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
  21. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
  22. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  23. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  24. package/dist/components/Quote/Quote.d.ts.map +1 -1
  25. package/dist/components/Quote/Quote.styles.d.ts +633 -3
  26. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  27. package/dist/components/Quote/Quote.types.d.ts +0 -1
  28. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  29. package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
  30. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  31. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  32. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  33. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  34. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  35. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  36. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  37. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  38. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  39. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  40. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  41. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
  42. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  43. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  44. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
  45. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
  46. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
  47. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  48. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  49. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
  50. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  51. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  52. package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
  53. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
  54. package/dist/components/TokenList/TokenList.styles.d.ts +942 -0
  55. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  56. package/dist/components/TokenList/TokenList.types.d.ts +3 -9
  57. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
  58. package/dist/components/TokenList/index.d.ts +0 -1
  59. package/dist/components/TokenList/index.d.ts.map +1 -1
  60. package/dist/components/UpdateUrl.d.ts +1 -6
  61. package/dist/components/UpdateUrl.d.ts.map +1 -1
  62. package/dist/components/WidgetEvents.d.ts.map +1 -1
  63. package/dist/constants/errors.d.ts.map +1 -1
  64. package/dist/constants/index.d.ts +1 -0
  65. package/dist/constants/index.d.ts.map +1 -1
  66. package/dist/constants/navigationRoutes.d.ts +1 -2
  67. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  68. package/dist/constants/searchParams.d.ts +2 -1
  69. package/dist/constants/searchParams.d.ts.map +1 -1
  70. package/dist/containers/App/App.d.ts +3 -0
  71. package/dist/containers/App/App.d.ts.map +1 -0
  72. package/dist/containers/App/App.styles.d.ts +158 -0
  73. package/dist/containers/App/App.styles.d.ts.map +1 -0
  74. package/dist/containers/App/index.d.ts +2 -0
  75. package/dist/containers/App/index.d.ts.map +1 -0
  76. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  77. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
  78. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  79. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
  80. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  81. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  82. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  83. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  84. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  85. package/dist/containers/Wallets/index.d.ts +2 -0
  86. package/dist/containers/Wallets/index.d.ts.map +1 -0
  87. package/dist/containers/Widget/Widget.d.ts +5 -0
  88. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  89. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  90. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  91. package/dist/containers/Widget/index.d.ts +3 -0
  92. package/dist/containers/Widget/index.d.ts.map +1 -0
  93. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  94. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  95. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
  96. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
  97. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
  98. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  99. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  100. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  101. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  102. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  103. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  104. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  105. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  106. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  107. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  108. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
  109. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
  110. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
  111. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
  112. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  113. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  114. package/dist/hooks/useLanguage.d.ts +1 -1
  115. package/dist/hooks/useLanguage.d.ts.map +1 -1
  116. package/dist/hooks/useNavigateBack.d.ts +1 -3
  117. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  118. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  119. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  120. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  121. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
  122. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  123. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  124. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  125. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  126. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  127. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  128. package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
  129. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  130. package/dist/hooks/useTheme.d.ts +1 -1
  131. package/dist/hooks/useTheme.d.ts.map +1 -1
  132. package/dist/hooks/useWalletList.d.ts.map +1 -1
  133. package/dist/index.d.ts +20 -8
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +1 -1
  136. package/dist/index.js.map +4 -4
  137. package/dist/pages/ConfirmSwapPage.d.ts +1 -6
  138. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  139. package/dist/pages/HistoryPage.d.ts.map +1 -1
  140. package/dist/pages/Home.d.ts.map +1 -1
  141. package/dist/pages/LanguagePage.d.ts.map +1 -1
  142. package/dist/pages/LiquiditySourcePage.d.ts +1 -2
  143. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  144. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  145. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  146. package/dist/pages/SettingsPage.d.ts +1 -6
  147. package/dist/pages/SettingsPage.d.ts.map +1 -1
  148. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  149. package/dist/pages/ThemePage.d.ts.map +1 -1
  150. package/dist/pages/WalletsPage.d.ts +1 -8
  151. package/dist/pages/WalletsPage.d.ts.map +1 -1
  152. package/dist/store/AppStore.d.ts +47 -0
  153. package/dist/store/AppStore.d.ts.map +1 -0
  154. package/dist/store/app.d.ts +41 -22
  155. package/dist/store/app.d.ts.map +1 -1
  156. package/dist/store/notification.d.ts +4 -3
  157. package/dist/store/notification.d.ts.map +1 -1
  158. package/dist/store/quote.d.ts +23 -16
  159. package/dist/store/quote.d.ts.map +1 -1
  160. package/dist/store/slices/config.d.ts +3 -2
  161. package/dist/store/slices/config.d.ts.map +1 -1
  162. package/dist/store/slices/data.d.ts +3 -0
  163. package/dist/store/slices/data.d.ts.map +1 -1
  164. package/dist/store/slices/settings.d.ts +39 -0
  165. package/dist/store/slices/settings.d.ts.map +1 -0
  166. package/dist/store/ui.d.ts +2 -1
  167. package/dist/store/ui.d.ts.map +1 -1
  168. package/dist/store/wallets.d.ts +14 -9
  169. package/dist/store/wallets.d.ts.map +1 -1
  170. package/dist/types/config.d.ts +38 -5
  171. package/dist/types/config.d.ts.map +1 -1
  172. package/dist/types/swap.d.ts +4 -14
  173. package/dist/types/swap.d.ts.map +1 -1
  174. package/dist/types/wallets.d.ts +15 -1
  175. package/dist/types/wallets.d.ts.map +1 -1
  176. package/dist/utils/colors.d.ts.map +1 -1
  177. package/dist/utils/configs.d.ts +1 -0
  178. package/dist/utils/configs.d.ts.map +1 -1
  179. package/dist/utils/meta.d.ts +2 -1
  180. package/dist/utils/meta.d.ts.map +1 -1
  181. package/dist/utils/providers.d.ts +2 -2
  182. package/dist/utils/providers.d.ts.map +1 -1
  183. package/dist/utils/queue.d.ts +2 -2
  184. package/dist/utils/queue.d.ts.map +1 -1
  185. package/dist/utils/quote.d.ts +1 -1
  186. package/dist/utils/quote.d.ts.map +1 -1
  187. package/dist/utils/settings.d.ts +6 -2
  188. package/dist/utils/settings.d.ts.map +1 -1
  189. package/dist/utils/swap.d.ts +16 -7
  190. package/dist/utils/swap.d.ts.map +1 -1
  191. package/dist/utils/time.d.ts +1 -1
  192. package/dist/utils/time.d.ts.map +1 -1
  193. package/dist/utils/wallets.d.ts +7 -9
  194. package/dist/utils/wallets.d.ts.map +1 -1
  195. package/package.json +12 -10
  196. package/src/QueueManager.tsx +18 -17
  197. package/src/components/AppRouter.tsx +8 -32
  198. package/src/components/AppRoutes.tsx +57 -69
  199. package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
  200. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  201. package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
  202. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
  203. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +20 -21
  204. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
  205. package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
  206. package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
  207. package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
  208. package/src/components/Layout/Layout.tsx +20 -7
  209. package/src/components/Layout/Layout.types.ts +2 -2
  210. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
  211. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
  212. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
  213. package/src/components/NoResult/NoResult.helpers.ts +12 -12
  214. package/src/components/NoResult/NoResult.tsx +6 -6
  215. package/src/components/NotificationContent/NotificationContent.tsx +5 -3
  216. package/src/components/Quote/Quote.styles.ts +42 -12
  217. package/src/components/Quote/Quote.tsx +106 -37
  218. package/src/components/Quote/Quote.types.ts +0 -1
  219. package/src/components/Quote/QuoteSkeleton.tsx +1 -1
  220. package/src/components/Quote/QuoteSummary.styles.ts +9 -8
  221. package/src/components/Quote/QuoteSummary.tsx +2 -2
  222. package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
  223. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
  224. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
  225. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
  226. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  227. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
  228. package/src/components/Slippage/Slippage.tsx +3 -5
  229. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -7
  230. package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
  231. package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
  232. package/src/components/SwapDetails/SwapDetails.tsx +33 -45
  233. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
  234. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  235. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  236. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
  237. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
  238. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  239. package/src/components/SwapsGroup/SwapsGroup.styles.ts +10 -1
  240. package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
  241. package/src/components/TokenList/TokenList.helpers.ts +2 -2
  242. package/src/components/TokenList/TokenList.styles.ts +58 -37
  243. package/src/components/TokenList/TokenList.tsx +28 -23
  244. package/src/components/TokenList/TokenList.types.ts +3 -10
  245. package/src/components/TokenList/index.ts +0 -1
  246. package/src/components/UpdateUrl.tsx +23 -18
  247. package/src/components/WidgetEvents.tsx +4 -2
  248. package/src/constants/errors.ts +9 -5
  249. package/src/constants/index.ts +1 -0
  250. package/src/constants/navigationRoutes.ts +7 -8
  251. package/src/constants/searchParams.ts +1 -0
  252. package/src/containers/App/App.styles.ts +18 -0
  253. package/src/containers/App/App.tsx +52 -0
  254. package/src/containers/App/index.ts +1 -0
  255. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
  256. package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
  257. package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
  258. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
  259. package/src/containers/Wallets/Wallets.types.ts +12 -0
  260. package/src/containers/Wallets/index.ts +1 -0
  261. package/src/containers/Widget/Widget.tsx +19 -0
  262. package/src/containers/Widget/Widget.types.ts +5 -0
  263. package/src/containers/Widget/index.ts +2 -0
  264. package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
  265. package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
  266. package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
  267. package/src/containers/WidgetInfo/index.ts +1 -0
  268. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  269. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  270. package/src/containers/WidgetProvider/index.ts +1 -0
  271. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
  272. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
  273. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
  274. package/src/hooks/useForceAutoConnect.ts +27 -0
  275. package/src/hooks/useLanguage.ts +4 -5
  276. package/src/hooks/useNavigateBack.ts +3 -52
  277. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  278. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  279. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  280. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  281. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
  282. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  283. package/src/hooks/useSwapInput.ts +89 -30
  284. package/src/hooks/useSyncStoresWithConfig.ts +38 -22
  285. package/src/hooks/useTheme.ts +4 -5
  286. package/src/hooks/useWalletList.ts +3 -5
  287. package/src/index.ts +53 -5
  288. package/src/pages/ConfirmSwapPage.tsx +61 -41
  289. package/src/pages/HistoryPage.tsx +2 -7
  290. package/src/pages/Home.tsx +58 -88
  291. package/src/pages/LanguagePage.tsx +0 -5
  292. package/src/pages/LiquiditySourcePage.tsx +24 -37
  293. package/src/pages/SelectBlockchainPage.tsx +28 -21
  294. package/src/pages/SelectSwapItemsPage.tsx +10 -27
  295. package/src/pages/SettingsPage.tsx +28 -24
  296. package/src/pages/SwapDetailsPage.tsx +6 -7
  297. package/src/pages/ThemePage.tsx +2 -7
  298. package/src/pages/WalletsPage.tsx +4 -15
  299. package/src/services/httpService.ts +1 -1
  300. package/src/store/AppStore.tsx +41 -0
  301. package/src/store/app.ts +44 -6
  302. package/src/store/quote.ts +29 -26
  303. package/src/store/slices/config.ts +25 -15
  304. package/src/store/slices/data.ts +64 -29
  305. package/src/store/slices/settings.ts +168 -0
  306. package/src/store/wallets.ts +68 -37
  307. package/src/types/config.ts +50 -5
  308. package/src/types/swap.ts +4 -13
  309. package/src/types/wallets.ts +18 -1
  310. package/src/utils/colors.ts +2 -1
  311. package/src/utils/configs.ts +2 -1
  312. package/src/utils/date.ts +1 -1
  313. package/src/utils/meta.ts +8 -1
  314. package/src/utils/providers.ts +8 -5
  315. package/src/utils/queue.ts +2 -2
  316. package/src/utils/quote.ts +7 -7
  317. package/src/utils/settings.ts +17 -10
  318. package/src/utils/swap.ts +59 -55
  319. package/src/utils/time.ts +1 -1
  320. package/src/utils/wallets.ts +107 -149
  321. package/dist/Wallets.d.ts +0 -17
  322. package/dist/Wallets.d.ts.map +0 -1
  323. package/dist/Widget.d.ts +0 -9
  324. package/dist/Widget.d.ts.map +0 -1
  325. package/dist/store/meta.d.ts +0 -23
  326. package/dist/store/meta.d.ts.map +0 -1
  327. package/dist/store/settings.d.ts +0 -81
  328. package/dist/store/settings.d.ts.map +0 -1
  329. package/src/Widget.tsx +0 -119
  330. package/src/store/meta.ts +0 -39
  331. package/src/store/settings.ts +0 -158
@@ -1,5 +1,3 @@
1
- import type { WidgetConfig } from '../types';
2
-
3
1
  import React from 'react';
4
2
  import { useRoutes } from 'react-router-dom';
5
3
 
@@ -16,15 +14,7 @@ import { SwapDetailsPage } from '../pages/SwapDetailsPage';
16
14
  import { ThemePage } from '../pages/ThemePage';
17
15
  import { WalletsPage } from '../pages/WalletsPage';
18
16
 
19
- const getAbsolutePath = (path: string) => path.replace('/', '');
20
-
21
- interface PropTypes {
22
- config?: WidgetConfig;
23
- }
24
-
25
- export function AppRoutes(props: PropTypes) {
26
- const { config } = props;
27
-
17
+ export function AppRoutes() {
28
18
  return useRoutes([
29
19
  {
30
20
  path: navigationRoutes.home,
@@ -32,77 +22,75 @@ export function AppRoutes(props: PropTypes) {
32
22
  },
33
23
  {
34
24
  path: navigationRoutes.fromSwap,
35
- element: <SelectSwapItemsPage type="source" />,
25
+ children: [
26
+ {
27
+ index: true,
28
+ element: <SelectSwapItemsPage type="source" />,
29
+ },
30
+ {
31
+ path: navigationRoutes.blockchains,
32
+ element: <SelectBlockchainPage type="source" />,
33
+ },
34
+ ],
36
35
  },
37
36
  {
38
37
  path: navigationRoutes.toSwap,
39
- element: <SelectSwapItemsPage type="destination" />,
40
- },
41
- {
42
- path: navigationRoutes.fromBlockchain,
43
- element: <SelectBlockchainPage type="source" />,
44
- },
45
- {
46
- path: navigationRoutes.toBlockchain,
47
- element: <SelectBlockchainPage type="destination" />,
38
+ children: [
39
+ {
40
+ index: true,
41
+ element: <SelectSwapItemsPage type="destination" />,
42
+ },
43
+ {
44
+ path: navigationRoutes.blockchains,
45
+ element: <SelectBlockchainPage type="destination" />,
46
+ },
47
+ ],
48
48
  },
49
49
  {
50
50
  path: navigationRoutes.settings,
51
- element: (
52
- <SettingsPage
53
- singleTheme={config?.theme?.singleTheme}
54
- supportedSwappers={config?.liquiditySources}
55
- />
56
- ),
57
- },
58
- {
59
- path: navigationRoutes.themes,
60
- element: <ThemePage />,
61
- },
62
- {
63
- path: navigationRoutes.languages,
64
- element: <LanguagePage />,
65
- },
66
- {
67
- path: navigationRoutes.exchanges,
68
- element: (
69
- <LiquiditySourcePage
70
- sourceType="Exchanges"
71
- supportedSwappers={config?.liquiditySources}
72
- />
73
- ),
74
- },
75
- {
76
- path: navigationRoutes.bridges,
77
- element: (
78
- <LiquiditySourcePage
79
- sourceType="Bridges"
80
- supportedSwappers={config?.liquiditySources}
81
- />
82
- ),
51
+ children: [
52
+ {
53
+ index: true,
54
+ element: <SettingsPage />,
55
+ },
56
+ {
57
+ path: navigationRoutes.themes,
58
+ element: <ThemePage />,
59
+ },
60
+ {
61
+ path: navigationRoutes.languages,
62
+ element: <LanguagePage />,
63
+ },
64
+ {
65
+ path: navigationRoutes.exchanges,
66
+ element: <LiquiditySourcePage sourceType="Exchanges" />,
67
+ },
68
+ {
69
+ path: navigationRoutes.bridges,
70
+ element: <LiquiditySourcePage sourceType="Bridges" />,
71
+ },
72
+ ],
83
73
  },
84
- { path: navigationRoutes.swaps, element: <HistoryPage /> },
85
74
  {
86
- path: navigationRoutes.swapDetails,
87
- element: <SwapDetailsPage />,
75
+ path: navigationRoutes.swaps,
76
+ children: [
77
+ {
78
+ index: true,
79
+ element: <HistoryPage />,
80
+ },
81
+ {
82
+ path: navigationRoutes.swapDetails,
83
+ element: <SwapDetailsPage />,
84
+ },
85
+ ],
88
86
  },
89
87
  {
90
88
  path: navigationRoutes.wallets,
91
- element: (
92
- <WalletsPage
93
- supportedWallets={config?.wallets}
94
- multiWallets={
95
- typeof config?.multiWallets === 'undefined'
96
- ? true
97
- : config.multiWallets
98
- }
99
- config={config}
100
- />
101
- ),
89
+ element: <WalletsPage />,
102
90
  },
103
91
  {
104
- path: getAbsolutePath(navigationRoutes.confirmSwap),
105
- element: <ConfirmSwapPage config={config} />,
92
+ path: navigationRoutes.confirmSwap,
93
+ element: <ConfirmSwapPage />,
106
94
  },
107
95
  ]);
108
96
  }
@@ -1,4 +1,4 @@
1
- import { styled } from '@rango-dev/ui';
1
+ import { ImageContainer, styled } from '@rango-dev/ui';
2
2
 
3
3
  export const Container = styled('div', {
4
4
  display: 'flex',
@@ -12,7 +12,7 @@ export const List = styled('ul', {
12
12
  listStyle: 'none',
13
13
  overflowY: 'auto',
14
14
  paddingRight: '$5',
15
- '.image-container': {
15
+ [`& ${ImageContainer}`]: {
16
16
  borderRadius: '$xm',
17
17
  overflow: 'hidden',
18
18
  },
@@ -11,7 +11,7 @@ import {
11
11
  } from '@rango-dev/ui';
12
12
  import React, { useEffect, useState } from 'react';
13
13
 
14
- import { useMetaStore } from '../../store/meta';
14
+ import { useAppStore } from '../../store/AppStore';
15
15
 
16
16
  import { filterBlockchains } from './BlockchainList.helpers';
17
17
  import { Container, List } from './BlockchainList.styles';
@@ -20,7 +20,7 @@ import { LoadingBlockchainList } from './LoadingBlockchainList';
20
20
  export function BlockchainList(props: PropTypes) {
21
21
  const { list, searchedFor, onChange, blockchainCategory } = props;
22
22
  const [blockchains, setBlockchains] = useState<BlockchainMeta[]>(list);
23
- const loadingStatus = useMetaStore.use.loadingStatus();
23
+ const { fetchStatus } = useAppStore();
24
24
 
25
25
  useEffect(() => {
26
26
  setBlockchains([
@@ -66,8 +66,8 @@ export function BlockchainList(props: PropTypes) {
66
66
  {i18n.t('Select Blockchain')}
67
67
  </Typography>
68
68
  <Divider size={4} />
69
- {loadingStatus === 'loading' && <LoadingBlockchainList />}
70
- {loadingStatus === 'success' && renderList()}
69
+ {fetchStatus === 'loading' && <LoadingBlockchainList />}
70
+ {fetchStatus === 'success' && renderList()}
71
71
  </Container>
72
72
  );
73
73
  }
@@ -13,7 +13,7 @@ import React from 'react';
13
13
 
14
14
  import { BLOCKCHAIN_LIST_SIZE } from '../../constants/configs';
15
15
  import { usePrepareBlockchainList } from '../../hooks/usePrepareBlockchainList';
16
- import { useMetaStore } from '../../store/meta';
16
+ import { useAppStore } from '../../store/AppStore';
17
17
  import { useQuoteStore } from '../../store/quote';
18
18
 
19
19
  import { Container } from './BlockchainsSection.styles';
@@ -27,7 +27,7 @@ export function BlockchainsSection(props: PropTypes) {
27
27
  selected: blockchain?.name,
28
28
  });
29
29
 
30
- const loadingStatus = useMetaStore.use.loadingStatus();
30
+ const { fetchStatus } = useAppStore();
31
31
  const resetToBlockchain = useQuoteStore.use.resetToBlockchain();
32
32
  const resetFromBlockchain = useQuoteStore.use.resetFromBlockchain();
33
33
  const hasMoreItemsInList = blockchainsList.more.length > 0;
@@ -45,11 +45,11 @@ export function BlockchainsSection(props: PropTypes) {
45
45
  </Typography>
46
46
  <Divider size={12} />
47
47
  <Container>
48
- {loadingStatus === 'loading' &&
48
+ {fetchStatus === 'loading' &&
49
49
  Array.from(Array(NUMBER_OF_LOADING), (e) => (
50
50
  <Skeleton key={e} variant="rounded" height={50} />
51
51
  ))}
52
- {loadingStatus === 'success' && (
52
+ {fetchStatus === 'success' && (
53
53
  <>
54
54
  <BlockchainsChip
55
55
  selected={!blockchain}
@@ -1,6 +1,7 @@
1
1
  import * as Collapsible from '@radix-ui/react-collapsible';
2
2
  import {
3
3
  Button,
4
+ css,
4
5
  darkTheme,
5
6
  IconButton,
6
7
  keyframes,
@@ -110,12 +111,13 @@ export const NavigateBack = styled(IconButton, {
110
111
 
111
112
  export const WalletsContainer = styled('div', {
112
113
  paddingTop: '$20',
113
- '& .wallets-list': {
114
- display: 'grid',
115
- gap: '$10',
116
- gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
117
- alignContent: 'baseline',
118
- },
114
+ });
115
+
116
+ export const walletsListStyles = css({
117
+ display: 'grid',
118
+ gap: '$10',
119
+ gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
120
+ alignContent: 'baseline',
119
121
  });
120
122
 
121
123
  export const CollapsibleRoot = styled(Collapsible.Root, {
@@ -171,6 +173,10 @@ export const CustomDestination = styled('div', {
171
173
  '& .alarms': { paddingTop: '5px' },
172
174
  });
173
175
 
176
+ export const alarmsStyles = css({
177
+ paddingTop: '5px',
178
+ });
179
+
174
180
  export const ExpandedIcon = styled('div', {
175
181
  transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
176
182
  variants: {
@@ -19,15 +19,16 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
19
19
  import { useNavigate } from 'react-router-dom';
20
20
 
21
21
  import { getQuoteErrorMessage } from '../../constants/errors';
22
- import { navigationRoutes } from '../../constants/navigationRoutes';
23
22
  import { getQuoteUpdateWarningMessage } from '../../constants/warnings';
24
- import { useMetaStore } from '../../store/meta';
23
+ import { useAppStore } from '../../store/AppStore';
25
24
  import { useQuoteStore } from '../../store/quote';
26
25
  import { useWalletsStore } from '../../store/wallets';
26
+ import { getBlockchainShortNameFor } from '../../utils/meta';
27
27
  import { confirmSwapDisabled } from '../../utils/swap';
28
28
 
29
29
  import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
30
30
  import {
31
+ alarmsStyles,
31
32
  CollapsibleContent,
32
33
  CollapsibleRoot,
33
34
  ConfirmButton,
@@ -43,6 +44,7 @@ import {
43
44
  Trigger,
44
45
  Wallets,
45
46
  WalletsContainer,
47
+ walletsListStyles,
46
48
  } from './ConfirmWallets.styles';
47
49
  import { WalletList } from './WalletList';
48
50
 
@@ -50,8 +52,9 @@ const NUMBER_OF_WALLETS_TO_DISPLAY = 2;
50
52
 
51
53
  export function ConfirmWalletsModal(props: PropTypes) {
52
54
  //TODO: move component's logics to a custom hook
53
- const { open, onClose, onCancel, onCheckBalance, config, loading } = props;
54
- const { blockchains } = useMetaStore.use.meta();
55
+ const { open, onClose, onCancel, onCheckBalance, loading } = props;
56
+ const config = useAppStore().config;
57
+ const blockchains = useAppStore().blockchains();
55
58
  const {
56
59
  quote,
57
60
  setSelectedWallets: selectQuoteWallets,
@@ -75,10 +78,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
75
78
  const customDestinationRef = useRef<HTMLDivElement | null>(null);
76
79
 
77
80
  const requiredWallets = getRequiredWallets(quote);
78
- const customDestinationEnabled =
79
- typeof config?.customDestination === 'undefined'
80
- ? true
81
- : config.customDestination;
82
81
 
83
82
  const lastStepToBlockchain = blockchains.find(
84
83
  (blockchain) =>
@@ -247,7 +246,8 @@ export function ConfirmWalletsModal(props: PropTypes) {
247
246
  open={open}
248
247
  onClose={() => {
249
248
  if (!quoteWalletsConfirmed) {
250
- navigate(navigationRoutes.home, { replace: true });
249
+ const home = '../';
250
+ navigate(home, { replace: true });
251
251
  }
252
252
  onClose();
253
253
  }}
@@ -288,7 +288,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
288
288
  <Typography variant="headline" size="small">
289
289
  {i18n.t({
290
290
  id: 'Your {blockchainName} wallets',
291
- values: { blockchainName: showMoreWalletFor },
291
+ values: {
292
+ blockchainName: getBlockchainShortNameFor(
293
+ showMoreWalletFor,
294
+ blockchains
295
+ ),
296
+ },
292
297
  })}
293
298
  </Typography>
294
299
  </ShowMoreHeader>
@@ -315,14 +320,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
315
320
  </Modal>
316
321
  {showMoreWalletFor && (
317
322
  <WalletsContainer>
318
- <div className="wallets-list">
323
+ <div className={walletsListStyles()}>
319
324
  <WalletList
320
325
  chain={showMoreWalletFor}
321
326
  isSelected={isSelected}
322
327
  selectWallet={onChange}
323
- multiWallets={config?.multiWallets ?? true}
324
- supportedWallets={config?.wallets ?? []}
325
- config={config}
326
328
  onShowMore={setShowMoreWalletFor.bind(null, showMoreWalletFor)}
327
329
  />
328
330
  </div>
@@ -361,7 +363,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
361
363
  <Typography variant="title" size="xmedium">
362
364
  {i18n.t({
363
365
  id: 'Your {blockchainName} wallets',
364
- values: { blockchainName: blockchain?.displayName },
366
+ values: { blockchainName: blockchain?.shortName },
365
367
  })}
366
368
  </Typography>
367
369
  <Typography
@@ -370,7 +372,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
370
372
  size="medium">
371
373
  {i18n.t({
372
374
  id: 'You need to connect a {blockchainName} wallet.',
373
- values: { blockchainName: blockchain?.displayName },
375
+ values: { blockchainName: blockchain?.shortName },
374
376
  })}
375
377
  </Typography>
376
378
  </Title>
@@ -380,9 +382,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
380
382
  chain={requiredWallet}
381
383
  isSelected={isSelected}
382
384
  selectWallet={onChange}
383
- multiWallets={config?.multiWallets ?? true}
384
- supportedWallets={config?.wallets ?? []}
385
- config={config}
386
385
  limit={NUMBER_OF_WALLETS_TO_DISPLAY}
387
386
  onShowMore={() =>
388
387
  setShowMoreWalletFor(blockchain?.name ?? '')
@@ -390,7 +389,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
390
389
  />
391
390
  </ListContainer>
392
391
  {!isLastWallet && <Divider size={32} />}
393
- {isLastWallet && customDestinationEnabled && (
392
+ {isLastWallet && config?.customDestination && (
394
393
  <CustomDestination>
395
394
  <CollapsibleRoot
396
395
  ref={customDestinationRef}
@@ -461,7 +460,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
461
460
  </CollapsibleContent>
462
461
  </CollapsibleRoot>
463
462
  {isAddressMatched && (
464
- <div className="alarms">
463
+ <div className={alarmsStyles()}>
465
464
  <Alert
466
465
  variant="alarm"
467
466
  type="error"
@@ -1,4 +1,3 @@
1
- import type { WidgetConfig } from '../..';
2
1
  import type { ConfirmSwap } from '../../hooks/useConfirmSwap/useConfirmSwap.types';
3
2
 
4
3
  export type PropTypes = {
@@ -6,6 +5,5 @@ export type PropTypes = {
6
5
  onClose: () => void;
7
6
  onCancel: () => void;
8
7
  onCheckBalance: ConfirmSwap['fetch'];
9
- config?: WidgetConfig;
10
8
  loading: boolean;
11
9
  };
@@ -23,7 +23,7 @@ import {
23
23
  TIME_TO_CLOSE_MODAL,
24
24
  TIME_TO_IGNORE_MODAL,
25
25
  } from '../../pages/WalletsPage';
26
- import { useMetaStore } from '../../store/meta';
26
+ import { useAppStore } from '../../store/AppStore';
27
27
  import { useWalletsStore } from '../../store/wallets';
28
28
  import { getBlockchainDisplayNameFor } from '../../utils/meta';
29
29
  import {
@@ -41,10 +41,11 @@ import {
41
41
  } from './WalletList.styles';
42
42
 
43
43
  export function WalletList(props: PropTypes) {
44
- const { config, chain, isSelected, selectWallet, limit, onShowMore } = props;
44
+ const { chain, isSelected, selectWallet, limit, onShowMore } = props;
45
+ const { config } = useAppStore();
45
46
 
46
47
  const connectedWallets = useWalletsStore.use.connectedWallets();
47
- const { blockchains } = useMetaStore.use.meta();
48
+ const { blockchains } = useAppStore();
48
49
  const [openWalletStateModal, setOpenWalletStateModal] =
49
50
  useState<WalletType>('');
50
51
  const [experimentalChainWallet, setExperimentalChainWallet] =
@@ -137,7 +138,7 @@ export function WalletList(props: PropTypes) {
137
138
  });
138
139
  const conciseAddress = address ? getConciseAddress(address) : '';
139
140
 
140
- const experimentalChain = isExperimentalChain(blockchains, chain);
141
+ const experimentalChain = isExperimentalChain(blockchains(), chain);
141
142
 
142
143
  const experimentalChainNotAdded = !connectedWallets.find(
143
144
  (connectedWallet) =>
@@ -180,7 +181,7 @@ export function WalletList(props: PropTypes) {
180
181
  experimentalChainWallet?.chain
181
182
  ? getBlockchainDisplayNameFor(
182
183
  experimentalChainWallet.chain,
183
- blockchains
184
+ blockchains()
184
185
  )
185
186
  : undefined;
186
187
  return (
@@ -1,12 +1,9 @@
1
- import type { Wallet, WidgetConfig } from '../../types';
1
+ import type { Wallet } from '../../types';
2
2
 
3
3
  export type PropTypes = {
4
4
  chain: string;
5
- supportedWallets: WidgetConfig['wallets'];
6
5
  isSelected: (walletType: string, chain: string) => boolean;
7
6
  selectWallet: (wallet: Wallet) => void;
8
- multiWallets: boolean;
9
- config?: WidgetConfig;
10
7
  limit?: number;
11
8
  onShowMore: () => void;
12
9
  };
@@ -11,7 +11,9 @@ import {
11
11
  } from '@rango-dev/ui';
12
12
  import React from 'react';
13
13
 
14
+ import { useAppStore } from '../../store/AppStore';
14
15
  import { getContainer } from '../../utils/common';
16
+ import { isFeatureHidden } from '../../utils/settings';
15
17
  import { NotificationContent } from '../NotificationContent';
16
18
 
17
19
  import { HeaderButton } from './HeaderButtons.styles';
@@ -26,6 +28,12 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
26
28
  onClickNotifications,
27
29
  } = props;
28
30
 
31
+ const {
32
+ config: { features },
33
+ } = useAppStore();
34
+
35
+ const isNotificationsHidden = isFeatureHidden('notification', features);
36
+
29
37
  return (
30
38
  <>
31
39
  <Tooltip
@@ -41,25 +49,27 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
41
49
  </HeaderButton>
42
50
  </Tooltip>
43
51
 
44
- <Tooltip
45
- container={getContainer()}
46
- side="top"
47
- content={i18n.t('Notifications')}>
48
- <Popover
49
- align="center"
50
- collisionBoundary={layoutRef}
51
- collisionPadding={{ right: 20, left: 20 }}
52
+ {!isNotificationsHidden && (
53
+ <Tooltip
52
54
  container={getContainer()}
53
- content={<NotificationContent />}>
54
- <HeaderButton
55
- size="small"
56
- variant="ghost"
57
- onClick={onClickNotifications}>
58
- <NotificationsIcon size={18} color="black" />
59
- <UnreadNotificationsBadge />
60
- </HeaderButton>
61
- </Popover>
62
- </Tooltip>
55
+ side="top"
56
+ content={i18n.t('Notifications')}>
57
+ <Popover
58
+ align="center"
59
+ collisionBoundary={layoutRef}
60
+ collisionPadding={{ right: 20, left: 20 }}
61
+ container={getContainer()}
62
+ content={<NotificationContent />}>
63
+ <HeaderButton
64
+ size="small"
65
+ variant="ghost"
66
+ onClick={onClickNotifications}>
67
+ <NotificationsIcon size={18} color="black" />
68
+ <UnreadNotificationsBadge />
69
+ </HeaderButton>
70
+ </Popover>
71
+ </Tooltip>
72
+ )}
63
73
  <Tooltip
64
74
  container={getContainer()}
65
75
  side="top"
@@ -3,12 +3,13 @@ import type { PropsWithChildren } from 'react';
3
3
 
4
4
  import { BottomLogo, Divider, Header } from '@rango-dev/ui';
5
5
  import React from 'react';
6
- import { useNavigate } from 'react-router-dom';
7
6
 
8
- import { navigationRoutes } from '../../constants/navigationRoutes';
7
+ import { useNavigateBack } from '../../hooks/useNavigateBack';
8
+ import { useAppStore } from '../../store/AppStore';
9
9
  import { useUiStore } from '../../store/ui';
10
10
  import { useWalletsStore } from '../../store/wallets';
11
11
  import { getContainer } from '../../utils/common';
12
+ import { isFeatureHidden } from '../../utils/settings';
12
13
  import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
13
14
 
14
15
  import { Container, Content, Footer } from './Layout.styles';
@@ -23,25 +24,37 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
23
24
  fixedHeight = true,
24
25
  } = props;
25
26
  const connectedWallets = useWalletsStore.use.connectedWallets();
27
+ const {
28
+ config: { features },
29
+ } = useAppStore();
30
+
31
+ const isConnectWalletHidden = isFeatureHidden(
32
+ 'connectWalletButton',
33
+ features
34
+ );
26
35
 
27
36
  const connectWalletsButtonDisabled =
28
37
  useUiStore.use.connectWalletsButtonDisabled();
29
- const navigate = useNavigate();
38
+ const navigateBack = useNavigateBack();
30
39
 
31
40
  const onConnectWallet = () => {
32
- if (!connectWalletsButtonDisabled) {
33
- navigate('/' + navigationRoutes.wallets);
41
+ if (!connectWalletsButtonDisabled && header.onWallet) {
42
+ header.onWallet();
34
43
  }
35
44
  };
45
+
46
+ const showBackButton =
47
+ typeof header.hasBackButton === 'undefined' || header.hasBackButton;
48
+
36
49
  return (
37
50
  <Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
38
51
  <Header
39
- prefix={<>{header.onBack && <BackButton onClick={header.onBack} />}</>}
52
+ prefix={<>{showBackButton && <BackButton onClick={navigateBack} />}</>}
40
53
  title={header.title}
41
54
  suffix={
42
55
  <>
43
56
  {header.suffix}
44
- {header.hasConnectWallet && (
57
+ {header.onWallet && !isConnectWalletHidden && (
45
58
  <WalletButton
46
59
  container={getContainer()}
47
60
  onClick={onConnectWallet}
@@ -1,10 +1,10 @@
1
1
  export interface PropTypes {
2
2
  header: {
3
3
  title: string;
4
- hasConnectWallet?: boolean;
4
+ onWallet?: () => void;
5
5
  hasSettings?: boolean;
6
6
  suffix?: React.ReactNode;
7
- onBack?: () => void;
7
+ hasBackButton?: boolean;
8
8
  onCancel?: () => void;
9
9
  };
10
10
  hasLogo?: boolean;
@@ -3,35 +3,42 @@ import type { StepSkeletonPropsTypes } from './LoadingSwapDetails.types';
3
3
  import { ChainToken, Divider, NextIcon, Skeleton } from '@rango-dev/ui';
4
4
  import React from 'react';
5
5
 
6
- import { StepContainer } from './LoadingSwapDetails.styles';
6
+ import {
7
+ extraInfoStyles,
8
+ StepContainer,
9
+ stepIconStyles,
10
+ stepInfoStyles,
11
+ stepTitleStyles,
12
+ stepTokensStyles,
13
+ } from './LoadingSwapDetails.styles';
7
14
 
8
15
  export function LoadingSwapDetailStep(props: StepSkeletonPropsTypes) {
9
16
  const { extraInfo } = props;
10
17
  return (
11
18
  <StepContainer>
12
- <div className="step-title">
19
+ <div className={stepTitleStyles()}>
13
20
  <Skeleton height={28} width={28} variant="circular" />
14
21
  <Divider direction="horizontal" size={8} />
15
22
  <Skeleton height={15} width={148} variant="rounded" />
16
23
  </div>
17
- <div className="step-tokens">
24
+ <div className={stepTokensStyles()}>
18
25
  <Divider direction="horizontal" size={20} />
19
- <div className="step-token-info">
26
+ <div className={stepInfoStyles()}>
20
27
  <ChainToken size="small" loading chainImage="" tokenImage="" />
21
28
  <Divider direction="horizontal" size={8} />
22
29
  <Skeleton height={12} width={76} variant="rounded" />
23
30
  </div>
24
- <div className="step-icon-container">
31
+ <div className={stepIconStyles()}>
25
32
  <NextIcon color="gray" size={16} />
26
33
  </div>
27
- <div className="step-token-info">
34
+ <div className={stepInfoStyles()}>
28
35
  <ChainToken size="small" loading chainImage="" tokenImage="" />
29
36
  <Divider direction="horizontal" size={8} />
30
37
  <Skeleton height={12} width={76} variant="rounded" />
31
38
  </div>
32
39
  </div>
33
40
  {extraInfo && (
34
- <div className="extra-info">
41
+ <div className={extraInfoStyles()}>
35
42
  <Divider direction="horizontal" size={20} />
36
43
  <Skeleton height={22} width={297} variant="rectangular" />
37
44
  </div>