@lifi/widget 1.15.1 → 1.17.0

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 (346) hide show
  1. package/App.js +21 -0
  2. package/AppProvider.d.ts +0 -4
  3. package/AppProvider.js +2 -10
  4. package/README.md +1 -1
  5. package/cjs/App.js +21 -0
  6. package/cjs/AppProvider.d.ts +0 -4
  7. package/cjs/AppProvider.js +3 -12
  8. package/cjs/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  9. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +45 -0
  10. package/cjs/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
  11. package/cjs/components/ActiveSwaps/ActiveSwaps.js +30 -0
  12. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  13. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +40 -0
  14. package/cjs/components/ActiveSwaps/index.d.ts +2 -0
  15. package/cjs/components/ActiveSwaps/index.js +18 -0
  16. package/cjs/components/AppContainer.js +2 -2
  17. package/cjs/components/Card/Card.d.ts +7 -4
  18. package/cjs/components/Card/Card.js +38 -28
  19. package/cjs/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
  20. package/cjs/components/ChainSelect/ChainSelect.js +35 -0
  21. package/cjs/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  22. package/cjs/components/ChainSelect/ChainSelect.style.js +19 -0
  23. package/cjs/components/ChainSelect/index.d.ts +2 -0
  24. package/cjs/components/ChainSelect/index.js +18 -0
  25. package/cjs/components/ChainSelect/useChainSelect.d.ts +8 -0
  26. package/cjs/components/ChainSelect/useChainSelect.js +33 -0
  27. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +3 -3
  28. package/cjs/components/Header/Header.js +1 -9
  29. package/cjs/components/Header/NavigationHeader.js +6 -11
  30. package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
  31. package/cjs/components/Header/useHeaderActionStore.js +1 -5
  32. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  33. package/cjs/components/PoweredBy/PoweredBy.style.js +1 -0
  34. package/cjs/components/SelectChainAndToken.js +5 -5
  35. package/cjs/components/SendToWallet/SendToWallet.js +6 -6
  36. package/cjs/components/Step/CircularProgress.js +1 -1
  37. package/cjs/components/Step/CircularProgress.style.js +1 -1
  38. package/cjs/components/Step/StepProcess.js +1 -5
  39. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  40. package/cjs/components/Step/StepTimer.d.ts +1 -0
  41. package/cjs/components/Step/StepTimer.js +6 -6
  42. package/cjs/components/SwapButton/SwapButton.js +5 -32
  43. package/cjs/components/SwapButton/types.d.ts +2 -2
  44. package/cjs/components/SwapRouteCard/SwapRouteCard.js +1 -1
  45. package/cjs/components/TokenAvatar/TokenAvatar.style.js +0 -3
  46. package/cjs/components/TokenList/TokenList.js +7 -3
  47. package/cjs/components/TokenList/TokenList.style.js +4 -3
  48. package/cjs/components/TokenList/TokenListItem.js +1 -1
  49. package/cjs/components/TokenList/TokenNotFound.d.ts +2 -1
  50. package/cjs/components/TokenList/TokenNotFound.js +12 -2
  51. package/cjs/components/TokenList/types.d.ts +2 -2
  52. package/cjs/config/theme.js +24 -23
  53. package/cjs/config/version.d.ts +1 -1
  54. package/cjs/config/version.js +1 -1
  55. package/cjs/hooks/index.d.ts +2 -0
  56. package/cjs/hooks/index.js +2 -0
  57. package/cjs/hooks/useChains.d.ts +1 -97
  58. package/cjs/hooks/useChains.js +26 -20
  59. package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
  60. package/cjs/hooks/useFeaturedTokens.js +6 -3
  61. package/cjs/hooks/useGasSufficiency.d.ts +1 -1
  62. package/cjs/hooks/useGasSufficiency.js +36 -28
  63. package/cjs/hooks/useInitializer.js +6 -0
  64. package/cjs/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  65. package/cjs/{components/Step/utils.js → hooks/useProcessMessage.js} +16 -10
  66. package/cjs/hooks/useRouteExecution.d.ts +1 -1
  67. package/cjs/hooks/useRouteExecution.js +26 -35
  68. package/cjs/hooks/useSwapRoutes.js +10 -11
  69. package/cjs/hooks/useToken.d.ts +0 -1
  70. package/cjs/hooks/useToken.js +1 -2
  71. package/cjs/hooks/useTokenBalances.d.ts +1 -2
  72. package/cjs/hooks/useTokenBalances.js +5 -6
  73. package/cjs/hooks/useTokenSearch.js +3 -2
  74. package/cjs/hooks/useTokens.d.ts +1 -2
  75. package/cjs/hooks/useTokens.js +32 -9
  76. package/cjs/hooks/useTools.js +11 -5
  77. package/cjs/hooks/useWidgetEvents.d.ts +3 -0
  78. package/cjs/hooks/useWidgetEvents.js +13 -0
  79. package/cjs/i18n/en/translation.json +14 -10
  80. package/cjs/i18n/index.d.ts +11 -7
  81. package/cjs/index.d.ts +1 -0
  82. package/cjs/index.js +3 -1
  83. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  84. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +18 -0
  85. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  86. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -0
  87. package/cjs/pages/ActiveSwapsPage/index.d.ts +1 -0
  88. package/cjs/{components/SwapsInProgress → pages/ActiveSwapsPage}/index.js +1 -1
  89. package/cjs/pages/MainPage/MainPage.js +2 -3
  90. package/cjs/pages/MainPage/MainSwapButton.js +3 -1
  91. package/cjs/pages/MainPage/SwapRoutes.js +4 -1
  92. package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  93. package/cjs/pages/SelectChainPage/SelectChainPage.js +33 -0
  94. package/cjs/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  95. package/cjs/pages/SelectChainPage/SelectChainPage.style.js +20 -0
  96. package/cjs/pages/SelectChainPage/index.d.ts +1 -0
  97. package/cjs/pages/SelectChainPage/index.js +17 -0
  98. package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  99. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -2
  100. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +4 -4
  101. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  102. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  103. package/cjs/pages/SettingsPage/AdvancedPreferences.js +1 -1
  104. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  105. package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +3 -6
  106. package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +3 -5
  107. package/cjs/pages/SettingsPage/GasPriceSelect.js +1 -1
  108. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +6 -2
  109. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +1 -1
  110. package/cjs/pages/SettingsPage/SlippageInput.js +1 -1
  111. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +3 -4
  112. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -3
  113. package/cjs/pages/SwapPage/StatusBottomSheet.js +25 -36
  114. package/cjs/pages/SwapPage/SwapPage.js +16 -3
  115. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +4 -3
  116. package/cjs/providers/SDKProvider/SDKProvider.d.ts +4 -0
  117. package/cjs/providers/SDKProvider/SDKProvider.js +27 -0
  118. package/cjs/providers/SDKProvider/index.d.ts +1 -0
  119. package/cjs/providers/SDKProvider/index.js +17 -0
  120. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +4 -30
  121. package/cjs/providers/SwapFormProvider/types.d.ts +5 -5
  122. package/cjs/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
  123. package/cjs/providers/TelemetryProvider/TelemetryProvider.js +11 -0
  124. package/cjs/providers/TelemetryProvider/index.d.ts +1 -0
  125. package/cjs/providers/TelemetryProvider/index.js +17 -0
  126. package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -4
  127. package/cjs/providers/WalletProvider/WalletProvider.js +59 -1
  128. package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -16
  129. package/cjs/providers/WidgetProvider/index.d.ts +1 -0
  130. package/cjs/providers/WidgetProvider/index.js +1 -0
  131. package/cjs/providers/WidgetProvider/utils.d.ts +4 -0
  132. package/cjs/providers/WidgetProvider/utils.js +13 -0
  133. package/cjs/providers/index.d.ts +2 -0
  134. package/cjs/providers/index.js +2 -0
  135. package/cjs/stores/chains/index.d.ts +3 -0
  136. package/cjs/stores/chains/index.js +19 -0
  137. package/cjs/stores/chains/types.d.ts +8 -0
  138. package/cjs/stores/chains/types.js +2 -0
  139. package/cjs/stores/chains/useChainOrder.d.ts +1 -0
  140. package/cjs/stores/chains/useChainOrder.js +12 -0
  141. package/cjs/stores/chains/useChainOrderStore.d.ts +19 -0
  142. package/cjs/stores/chains/useChainOrderStore.js +45 -0
  143. package/cjs/stores/route/index.d.ts +2 -1
  144. package/cjs/stores/route/index.js +2 -1
  145. package/cjs/stores/route/useExecutingRoutesIds.d.ts +1 -0
  146. package/cjs/stores/route/useExecutingRoutesIds.js +20 -0
  147. package/cjs/stores/route/useRouteStore.js +5 -4
  148. package/cjs/stores/route/utils.d.ts +4 -0
  149. package/cjs/stores/route/utils.js +21 -0
  150. package/cjs/stores/settings/index.d.ts +0 -1
  151. package/cjs/stores/settings/index.js +0 -1
  152. package/cjs/stores/settings/useAppearance.js +3 -1
  153. package/cjs/stores/settings/useSettingsStore.js +5 -2
  154. package/cjs/types/events.d.ts +5 -0
  155. package/cjs/types/events.js +9 -0
  156. package/cjs/types/index.d.ts +1 -0
  157. package/cjs/types/index.js +1 -0
  158. package/cjs/types/widget.d.ts +31 -23
  159. package/cjs/utils/colors.d.ts +1 -1
  160. package/cjs/utils/navigationRoutes.d.ts +5 -0
  161. package/cjs/utils/navigationRoutes.js +31 -4
  162. package/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  163. package/components/ActiveSwaps/ActiveSwapItem.js +41 -0
  164. package/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
  165. package/components/ActiveSwaps/ActiveSwaps.js +26 -0
  166. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  167. package/components/ActiveSwaps/ActiveSwaps.style.js +37 -0
  168. package/components/ActiveSwaps/index.d.ts +2 -0
  169. package/components/ActiveSwaps/index.js +2 -0
  170. package/components/AppContainer.js +1 -1
  171. package/components/Card/Card.d.ts +7 -4
  172. package/components/Card/Card.js +39 -29
  173. package/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
  174. package/components/ChainSelect/ChainSelect.js +31 -0
  175. package/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  176. package/components/ChainSelect/ChainSelect.style.js +16 -0
  177. package/components/ChainSelect/index.d.ts +2 -0
  178. package/components/ChainSelect/index.js +2 -0
  179. package/components/ChainSelect/useChainSelect.d.ts +8 -0
  180. package/components/ChainSelect/useChainSelect.js +29 -0
  181. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +3 -3
  182. package/components/Header/Header.js +1 -9
  183. package/components/Header/NavigationHeader.js +6 -11
  184. package/components/Header/useHeaderActionStore.d.ts +0 -2
  185. package/components/Header/useHeaderActionStore.js +0 -3
  186. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  187. package/components/PoweredBy/PoweredBy.style.js +1 -0
  188. package/components/SelectChainAndToken.js +1 -1
  189. package/components/SendToWallet/SendToWallet.js +6 -6
  190. package/components/Step/CircularProgress.js +3 -3
  191. package/components/Step/CircularProgress.style.js +1 -1
  192. package/components/Step/StepProcess.js +2 -6
  193. package/components/Step/StepProcess.style.d.ts +1 -1
  194. package/components/Step/StepTimer.d.ts +1 -0
  195. package/components/Step/StepTimer.js +6 -6
  196. package/components/SwapButton/SwapButton.js +7 -34
  197. package/components/SwapButton/types.d.ts +2 -2
  198. package/components/SwapRouteCard/SwapRouteCard.js +1 -1
  199. package/components/TokenAvatar/TokenAvatar.style.js +0 -3
  200. package/components/TokenList/TokenList.js +7 -3
  201. package/components/TokenList/TokenList.style.js +4 -3
  202. package/components/TokenList/TokenListItem.js +1 -1
  203. package/components/TokenList/TokenNotFound.d.ts +2 -1
  204. package/components/TokenList/TokenNotFound.js +12 -2
  205. package/components/TokenList/types.d.ts +2 -2
  206. package/config/theme.js +24 -23
  207. package/config/version.d.ts +1 -1
  208. package/config/version.js +1 -1
  209. package/hooks/index.d.ts +2 -0
  210. package/hooks/index.js +2 -0
  211. package/hooks/useChains.d.ts +1 -97
  212. package/hooks/useChains.js +26 -20
  213. package/hooks/useFeaturedTokens.d.ts +1 -1
  214. package/hooks/useFeaturedTokens.js +6 -3
  215. package/hooks/useGasSufficiency.d.ts +1 -1
  216. package/hooks/useGasSufficiency.js +32 -24
  217. package/hooks/useInitializer.js +6 -0
  218. package/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  219. package/{pages/SwapPage/utils.js → hooks/useProcessMessage.js} +15 -10
  220. package/hooks/useRouteExecution.d.ts +1 -1
  221. package/hooks/useRouteExecution.js +26 -35
  222. package/hooks/useSwapRoutes.js +3 -4
  223. package/hooks/useToken.d.ts +0 -1
  224. package/hooks/useToken.js +1 -2
  225. package/hooks/useTokenBalances.d.ts +1 -2
  226. package/hooks/useTokenBalances.js +4 -5
  227. package/hooks/useTokenSearch.js +3 -2
  228. package/hooks/useTokens.d.ts +1 -2
  229. package/hooks/useTokens.js +32 -9
  230. package/hooks/useTools.js +11 -5
  231. package/hooks/useWidgetEvents.d.ts +3 -0
  232. package/hooks/useWidgetEvents.js +6 -0
  233. package/i18n/en/translation.json +14 -10
  234. package/i18n/index.d.ts +11 -7
  235. package/index.d.ts +1 -0
  236. package/index.js +1 -0
  237. package/package.json +15 -14
  238. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  239. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +14 -0
  240. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  241. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +17 -0
  242. package/pages/ActiveSwapsPage/index.d.ts +1 -0
  243. package/pages/ActiveSwapsPage/index.js +1 -0
  244. package/pages/MainPage/MainPage.js +2 -3
  245. package/pages/MainPage/MainSwapButton.js +3 -1
  246. package/pages/MainPage/SwapRoutes.js +4 -1
  247. package/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  248. package/pages/SelectChainPage/SelectChainPage.js +29 -0
  249. package/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  250. package/pages/SelectChainPage/SelectChainPage.style.js +17 -0
  251. package/pages/SelectChainPage/index.d.ts +1 -0
  252. package/pages/SelectChainPage/index.js +1 -0
  253. package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  254. package/pages/SelectTokenPage/SelectTokenPage.js +2 -2
  255. package/pages/SelectWalletPage/SelectWalletPage.js +5 -5
  256. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  257. package/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  258. package/pages/SettingsPage/AdvancedPreferences.js +2 -2
  259. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  260. package/pages/SettingsPage/EnabledBridgesSelect.js +4 -7
  261. package/pages/SettingsPage/EnabledExchangesSelect.js +4 -6
  262. package/pages/SettingsPage/GasPriceSelect.js +2 -2
  263. package/pages/SettingsPage/RoutePrioritySelect.js +7 -3
  264. package/pages/SettingsPage/ShowDestinationWallet.js +2 -2
  265. package/pages/SettingsPage/SlippageInput.js +2 -2
  266. package/pages/SwapDetailsPage/SwapDetailsPage.js +4 -5
  267. package/pages/SwapHistoryPage/SwapHistoryPage.js +3 -4
  268. package/pages/SwapPage/StatusBottomSheet.js +27 -38
  269. package/pages/SwapPage/SwapPage.js +16 -3
  270. package/pages/SwapRoutesPage/SwapRoutesPage.js +5 -4
  271. package/providers/SDKProvider/SDKProvider.d.ts +4 -0
  272. package/providers/SDKProvider/SDKProvider.js +19 -0
  273. package/providers/SDKProvider/index.d.ts +1 -0
  274. package/providers/SDKProvider/index.js +1 -0
  275. package/providers/SwapFormProvider/SwapFormProvider.js +4 -30
  276. package/providers/SwapFormProvider/types.d.ts +5 -5
  277. package/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
  278. package/providers/TelemetryProvider/TelemetryProvider.js +7 -0
  279. package/providers/TelemetryProvider/index.d.ts +1 -0
  280. package/providers/TelemetryProvider/index.js +1 -0
  281. package/providers/WalletProvider/WalletProvider.d.ts +1 -4
  282. package/providers/WalletProvider/WalletProvider.js +59 -1
  283. package/providers/WidgetProvider/WidgetProvider.js +3 -18
  284. package/providers/WidgetProvider/index.d.ts +1 -0
  285. package/providers/WidgetProvider/index.js +1 -0
  286. package/providers/WidgetProvider/utils.d.ts +4 -0
  287. package/providers/WidgetProvider/utils.js +9 -0
  288. package/providers/index.d.ts +2 -0
  289. package/providers/index.js +2 -0
  290. package/stores/chains/index.d.ts +3 -0
  291. package/stores/chains/index.js +3 -0
  292. package/stores/chains/types.d.ts +8 -0
  293. package/stores/chains/types.js +1 -0
  294. package/stores/chains/useChainOrder.d.ts +1 -0
  295. package/stores/chains/useChainOrder.js +5 -0
  296. package/stores/chains/useChainOrderStore.d.ts +19 -0
  297. package/stores/chains/useChainOrderStore.js +39 -0
  298. package/stores/route/index.d.ts +2 -1
  299. package/stores/route/index.js +2 -1
  300. package/stores/route/useExecutingRoutesIds.d.ts +1 -0
  301. package/stores/route/useExecutingRoutesIds.js +13 -0
  302. package/stores/route/useRouteStore.js +5 -4
  303. package/stores/route/utils.d.ts +4 -0
  304. package/stores/route/utils.js +15 -0
  305. package/stores/settings/index.d.ts +0 -1
  306. package/stores/settings/index.js +0 -1
  307. package/stores/settings/useAppearance.js +3 -1
  308. package/stores/settings/useSettingsStore.js +5 -2
  309. package/tsconfig.cjs.tsbuildinfo +1 -1
  310. package/types/events.d.ts +5 -0
  311. package/types/events.js +6 -0
  312. package/types/index.d.ts +1 -0
  313. package/types/index.js +1 -0
  314. package/types/widget.d.ts +31 -23
  315. package/utils/colors.d.ts +1 -1
  316. package/utils/navigationRoutes.d.ts +5 -0
  317. package/utils/navigationRoutes.js +30 -3
  318. package/cjs/components/SwapButton/SwapButton.style.d.ts +0 -65
  319. package/cjs/components/SwapButton/SwapButton.style.js +0 -15
  320. package/cjs/components/SwapsInProgress/SwapsInProgress.js +0 -29
  321. package/cjs/components/SwapsInProgress/SwapsInProgress.style.js +0 -17
  322. package/cjs/components/SwapsInProgress/index.d.ts +0 -1
  323. package/cjs/config/lifi.d.ts +0 -4
  324. package/cjs/config/lifi.js +0 -14
  325. package/cjs/pages/SelectTokenPage/ChainSelect.js +0 -31
  326. package/cjs/pages/SwapPage/utils.d.ts +0 -6
  327. package/cjs/pages/SwapPage/utils.js +0 -93
  328. package/cjs/stores/route/useExecutingRoutes.d.ts +0 -2
  329. package/cjs/stores/route/useExecutingRoutes.js +0 -13
  330. package/cjs/stores/settings/useSetSettings.d.ts +0 -5
  331. package/cjs/stores/settings/useSetSettings.js +0 -12
  332. package/components/Step/utils.js +0 -89
  333. package/components/SwapButton/SwapButton.style.d.ts +0 -65
  334. package/components/SwapButton/SwapButton.style.js +0 -12
  335. package/components/SwapsInProgress/SwapsInProgress.js +0 -25
  336. package/components/SwapsInProgress/SwapsInProgress.style.js +0 -14
  337. package/components/SwapsInProgress/index.d.ts +0 -1
  338. package/components/SwapsInProgress/index.js +0 -1
  339. package/config/lifi.d.ts +0 -4
  340. package/config/lifi.js +0 -7
  341. package/pages/SelectTokenPage/ChainSelect.js +0 -27
  342. package/pages/SwapPage/utils.d.ts +0 -6
  343. package/stores/route/useExecutingRoutes.d.ts +0 -2
  344. package/stores/route/useExecutingRoutes.js +0 -6
  345. package/stores/settings/useSetSettings.d.ts +0 -5
  346. package/stores/settings/useSetSettings.js +0 -5
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SwapHoriz as SwapHorizIcon } from '@mui/icons-material';
3
+ import { Container, Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ export const ActiveSwapsEmpty = () => {
6
+ const { t } = useTranslation();
7
+ return (_jsxs(Container, Object.assign({ sx: {
8
+ display: 'flex',
9
+ flex: 1,
10
+ flexDirection: 'column',
11
+ alignItems: 'center',
12
+ justifyContent: 'center',
13
+ } }, { children: [_jsx(Typography, Object.assign({ fontSize: 48 }, { children: _jsx(SwapHorizIcon, { fontSize: "inherit" }) })), _jsx(Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.emptyActiveSwaps') })), _jsx(Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.emptyActiveSwaps') }))] })));
14
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ActiveSwapsPage: () => JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Container, List } from '@mui/material';
3
+ import { ActiveSwapItem } from '../../components/ActiveSwaps';
4
+ import { useWallet } from '../../providers';
5
+ import { useExecutingRoutesIds } from '../../stores';
6
+ import { ActiveSwapsEmpty } from './ActiveSwapsEmpty';
7
+ export const ActiveSwapsPage = () => {
8
+ const { account } = useWallet();
9
+ const executingRoutes = useExecutingRoutesIds(account.address);
10
+ if (!executingRoutes.length) {
11
+ return _jsx(ActiveSwapsEmpty, {});
12
+ }
13
+ return (_jsx(Container, Object.assign({ disableGutters: true }, { children: _jsx(List, Object.assign({ sx: {
14
+ paddingLeft: 1.5,
15
+ paddingRight: 1.5,
16
+ } }, { children: executingRoutes.map((routeId) => (_jsx(ActiveSwapItem, { routeId: routeId }, routeId))) })) })));
17
+ };
@@ -0,0 +1 @@
1
+ export * from './ActiveSwapsPage';
@@ -0,0 +1 @@
1
+ export * from './ActiveSwapsPage';
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from '@mui/material';
3
+ import { ActiveSwaps } from '../../components/ActiveSwaps';
3
4
  import { SelectChainAndToken } from '../../components/SelectChainAndToken';
4
- import { SendToWallet } from '../../components/SendToWallet';
5
5
  import { SwapInput } from '../../components/SwapInput';
6
- import { SwapsInProgress } from '../../components/SwapsInProgress';
7
6
  import { FormContainer } from './MainPage.style';
8
7
  import { MainSwapButton } from './MainSwapButton';
9
8
  import { SwapRoutes } from './SwapRoutes';
10
9
  export const MainPage = () => {
11
- return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(SwapsInProgress, { mx: 3, mt: 1, mb: 2 }), _jsx(SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 3 }, { children: _jsx(SwapInput, { formType: "from" }) })), _jsx(SendToWallet, { mx: 3, mb: 3 }), _jsx(SwapRoutes, { mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 1 }, { children: _jsx(MainSwapButton, {}) }))] })));
10
+ return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), _jsx(SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 3 }, { children: _jsx(SwapInput, { formType: "from" }) })), _jsx(SwapRoutes, { mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 1 }, { children: _jsx(MainSwapButton, {}) }))] })));
12
11
  };
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { useFormState } from 'react-hook-form';
11
12
  import { useNavigate } from 'react-router-dom';
12
13
  import { SwapButton } from '../../components/SwapButton';
13
14
  import { useSwapRoutes } from '../../hooks';
@@ -15,6 +16,7 @@ import { useSetExecutableRoute } from '../../stores';
15
16
  import { navigationRoutes } from '../../utils';
16
17
  export const MainSwapButton = () => {
17
18
  const navigate = useNavigate();
19
+ const { isValid, isValidating } = useFormState();
18
20
  const setExecutableRoute = useSetExecutableRoute();
19
21
  const { routes: swapRoutes, isLoading, isFetching } = useSwapRoutes();
20
22
  const currentRoute = swapRoutes === null || swapRoutes === void 0 ? void 0 : swapRoutes[0];
@@ -26,5 +28,5 @@ export const MainSwapButton = () => {
26
28
  });
27
29
  }
28
30
  });
29
- return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute, loading: isLoading || isFetching || !currentRoute }));
31
+ return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute, disable: isLoading || isFetching || isValidating || !isValid }));
30
32
  };
@@ -3,11 +3,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { KeyboardArrowRight as KeyboardArrowRightIcon } from '@mui/icons-material';
4
4
  import { Box, IconButton } from '@mui/material';
5
5
  import { useCallback } from 'react';
6
+ import { useFormState } from 'react-hook-form';
6
7
  import { useTranslation } from 'react-i18next';
7
8
  import { useNavigate } from 'react-router-dom';
8
9
  import { Card, CardTitle } from '../../components/Card';
9
10
  import { GasSufficiencyMessage } from '../../components/GasSufficiencyMessage';
10
11
  import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate';
12
+ import { SendToWallet } from '../../components/SendToWallet';
11
13
  import { SwapRouteCard, SwapRouteCardSkeleton, SwapRouteNotFoundCard, } from '../../components/SwapRouteCard';
12
14
  import { useSwapRoutes } from '../../hooks';
13
15
  import { navigationRoutes } from '../../utils';
@@ -15,6 +17,7 @@ import { Stack } from './SwapRoutes.style';
15
17
  export const SwapRoutes = (props) => {
16
18
  const { t } = useTranslation();
17
19
  const navigate = useNavigate();
20
+ const { isValid, isValidating } = useFormState();
18
21
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = useSwapRoutes();
19
22
  const handleCardClick = useCallback(() => {
20
23
  navigate(navigationRoutes.swapRoutes);
@@ -32,5 +35,5 @@ export const SwapRoutes = (props) => {
32
35
  borderWidth: !routeNotFound && (isFetching || (routes && routes.length > 1))
33
36
  ? 1
34
37
  : 0,
35
- } }, { children: isLoading || isFetching ? (_jsxs(_Fragment, { children: [_jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), _jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? (_jsx(SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : (_jsxs(_Fragment, { children: [_jsx(SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? (_jsx(SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? (_jsx(Box, Object.assign({ py: 1, pr: 1 }, { children: _jsx(IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes" }, { children: _jsx(KeyboardArrowRightIcon, {}) })) }))) : null }))] }))] })), _jsx(GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props))] }));
38
+ } }, { children: isLoading || isFetching ? (_jsxs(_Fragment, { children: [_jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), _jsx(SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? (_jsx(SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : (_jsxs(_Fragment, { children: [_jsx(SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? (_jsx(SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? (_jsx(Box, Object.assign({ py: 1, pr: 1 }, { children: _jsx(IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes", disabled: isValidating || !isValid }, { children: _jsx(KeyboardArrowRightIcon, {}) })) }))) : null }))] }))] })), _jsx(GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props)), _jsx(SendToWallet, { mx: 3, mb: 3 })] }));
36
39
  };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SelectChainPage: React.FC<Partial<SwapFormTypeProps>>;
@@ -0,0 +1,29 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { Avatar, Container, List, ListItemAvatar } from '@mui/material';
12
+ import { useLocation } from 'react-router-dom';
13
+ import { useChainSelect } from '../../components/ChainSelect';
14
+ import { useNavigateBack } from '../../hooks';
15
+ import { ListItemButton, ListItemText } from './SelectChainPage.style';
16
+ export const SelectChainPage = ({ formType, }) => {
17
+ const { navigateBack } = useNavigateBack();
18
+ const { state } = useLocation();
19
+ const formTypeState = (state === null || state === void 0 ? void 0 : state.formType) || formType;
20
+ const { chains, setCurrentChain } = useChainSelect(formTypeState);
21
+ const handleClick = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
22
+ setCurrentChain(chainId);
23
+ navigateBack();
24
+ });
25
+ return (_jsx(Container, Object.assign({ disableGutters: true }, { children: _jsx(List, Object.assign({ sx: {
26
+ paddingLeft: 1.5,
27
+ paddingRight: 1.5,
28
+ } }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => (_jsxs(ListItemButton, Object.assign({ onClick: () => handleClick(chain.id), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] })) }), _jsx(ListItemText, { primary: chain.name })] }), chain.id))) })) })));
29
+ };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
+ centerRipple?: boolean | undefined;
5
+ children?: import("react").ReactNode;
6
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
7
+ disabled?: boolean | undefined;
8
+ disableRipple?: boolean | undefined;
9
+ disableTouchRipple?: boolean | undefined;
10
+ focusRipple?: boolean | undefined;
11
+ focusVisibleClassName?: string | undefined;
12
+ LinkComponent?: import("react").ElementType<any> | undefined;
13
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
14
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
+ tabIndex?: number | undefined;
16
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
17
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
+ }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,17 @@
1
+ import { ListItemButton as MuiListItemButton, ListItemText as MuiListItemText, } from '@mui/material';
2
+ import { listItemTextClasses } from '@mui/material/ListItemText';
3
+ import { styled } from '@mui/material/styles';
4
+ import { getContrastAlphaColor } from '../../utils';
5
+ export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
6
+ borderRadius: theme.shape.borderRadiusSecondary,
7
+ paddingLeft: theme.spacing(1.5),
8
+ height: 56,
9
+ '&:hover': {
10
+ backgroundColor: getContrastAlphaColor(theme, '4%'),
11
+ },
12
+ }));
13
+ export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
14
+ [`.${listItemTextClasses.primary}`]: {
15
+ fontWeight: 400,
16
+ },
17
+ }));
@@ -0,0 +1 @@
1
+ export * from './SelectChainPage';
@@ -0,0 +1 @@
1
+ export * from './SelectChainPage';
@@ -1,5 +1,3 @@
1
1
  import type { FC } from 'react';
2
- import type { SwapFormDirection } from '../../providers';
3
- export declare const SelectTokenPage: FC<{
4
- formType: SwapFormDirection;
5
- }>;
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SelectTokenPage: FC<SwapFormTypeProps>;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Container } from '@mui/material';
3
3
  import { useLayoutEffect, useRef, useState } from 'react';
4
+ import { ChainSelect } from '../../components/ChainSelect';
4
5
  import { TokenList } from '../../components/TokenList';
5
6
  import { useContentHeight, useNavigateBack, useScrollableOverflowHidden, } from '../../hooks';
6
- import { ChainSelect } from './ChainSelect';
7
7
  import { SearchTokenInput } from './SearchTokenInput';
8
- export const SelectTokenPage = ({ formType, }) => {
8
+ export const SelectTokenPage = ({ formType }) => {
9
9
  useScrollableOverflowHidden();
10
10
  const { navigateBack } = useNavigateBack();
11
11
  const headerRef = useRef(null);
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { Dialog } from '../../components/Dialog';
16
16
  import { useNavigateBack } from '../../hooks';
17
17
  import { useWallet } from '../../providers';
18
- import { WalletListItemButton, WalletListItemText, } from './SelectWalletPage.style';
18
+ import { ListItemButton, ListItemText } from './SelectWalletPage.style';
19
19
  export const SelectWalletPage = () => {
20
20
  var _a;
21
21
  const { t } = useTranslation();
@@ -25,7 +25,7 @@ export const SelectWalletPage = () => {
25
25
  const closeDialog = () => {
26
26
  setWalletIdentity((state) => (Object.assign(Object.assign({}, state), { show: false })));
27
27
  };
28
- const handleConnect = useCallback((event, wallet) => __awaiter(void 0, void 0, void 0, function* () {
28
+ const handleConnect = useCallback((wallet) => __awaiter(void 0, void 0, void 0, function* () {
29
29
  const { ethereum } = window;
30
30
  const identityCheckPassed = wallet.checkProviderIdentity({
31
31
  provider: ethereum,
@@ -41,9 +41,9 @@ export const SelectWalletPage = () => {
41
41
  yield connect(wallet);
42
42
  }), [connect, navigateBack]);
43
43
  return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsx(List, Object.assign({ sx: {
44
- paddingLeft: 2,
45
- paddingRight: 2,
46
- } }, { children: supportedWallets.map((wallet) => (_jsxs(WalletListItemButton, Object.assign({ onClick: (event) => handleConnect(event, wallet), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), _jsx(WalletListItemText, { primary: wallet.name })] }), wallet.name))) })), _jsxs(Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('wallet.extensionNotFound', {
44
+ paddingLeft: 1.5,
45
+ paddingRight: 1.5,
46
+ } }, { children: supportedWallets.map((wallet) => (_jsxs(ListItemButton, Object.assign({ onClick: () => handleConnect(wallet), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), _jsx(ListItemText, { primary: wallet.name })] }), wallet.name))) })), _jsxs(Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [_jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('wallet.extensionNotFound', {
47
47
  name: (_a = walletIdentity.wallet) === null || _a === void 0 ? void 0 : _a.name,
48
48
  }) }) }), _jsx(DialogActions, { children: _jsx(Button, Object.assign({ onClick: closeDialog, autoFocus: true }, { children: t('button.ok') })) })] }))] })));
49
49
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const WalletListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
2
+ export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
3
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
4
  centerRipple?: boolean | undefined;
5
5
  children?: import("react").ReactNode;
@@ -18,29 +18,4 @@ export declare const WalletListItemButton: import("@emotion/styled").StyledCompo
18
18
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
19
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
20
  }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
- export declare const WalletListItem: import("@emotion/styled").StyledComponent<{
22
- button?: false | undefined;
23
- } & import("@mui/material").ListItemBaseProps & {
24
- components?: {
25
- Root?: import("react").ElementType<any> | undefined;
26
- } | undefined;
27
- componentsProps?: {
28
- root?: (import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides) | undefined;
29
- } | undefined;
30
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
31
- ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
32
- }, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
33
- export declare const WalletListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
34
- export declare const WalletIdentityPopoverContent: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
36
- children?: import("react").ReactNode;
37
- classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
38
- gutterBottom?: boolean | undefined;
39
- noWrap?: boolean | undefined;
40
- paragraph?: boolean | undefined;
41
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
42
- variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
43
- variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
44
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
45
- ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
46
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,27 +1,17 @@
1
- import { ListItem, ListItemButton, ListItemText, Typography, } from '@mui/material';
2
- import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
1
+ import { ListItemButton as MuiListItemButton, ListItemText as MuiListItemText, } from '@mui/material';
3
2
  import { listItemTextClasses } from '@mui/material/ListItemText';
4
3
  import { styled } from '@mui/material/styles';
5
4
  import { getContrastAlphaColor } from '../../utils';
6
- export const WalletListItemButton = styled(ListItemButton)(({ theme }) => ({
5
+ export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
7
6
  borderRadius: theme.shape.borderRadiusSecondary,
8
7
  paddingLeft: theme.spacing(1.5),
9
- height: 64,
8
+ height: 56,
10
9
  '&:hover': {
11
10
  backgroundColor: getContrastAlphaColor(theme, '4%'),
12
11
  },
13
12
  }));
14
- export const WalletListItem = styled(ListItem)(({ theme }) => ({
15
- padding: theme.spacing(1.5),
16
- [`.${listItemSecondaryActionClasses.root}`]: {
17
- right: theme.spacing(3),
18
- },
19
- }));
20
- export const WalletListItemText = styled(ListItemText)(({ theme }) => ({
13
+ export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
21
14
  [`.${listItemTextClasses.primary}`]: {
22
15
  fontWeight: 400,
23
16
  },
24
17
  }));
25
- export const WalletIdentityPopoverContent = styled(Typography)({
26
- maxWidth: 400,
27
- });
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Typography } from '@mui/material';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { Switch } from '../../components/Switch';
5
- import { useSetSettings, useSettings } from '../../stores';
5
+ import { useSettings, useSettingsStore } from '../../stores';
6
6
  import { EnabledBridgesSelect } from './EnabledBridgesSelect';
7
7
  import { EnabledExchangesSelect } from './EnabledExchangesSelect';
8
8
  export const AdvancedPreferences = () => {
9
9
  const { t } = useTranslation();
10
- const [setValue] = useSetSettings();
10
+ const setValue = useSettingsStore((state) => state.setValue);
11
11
  const { advancedPreferences } = useSettings(['advancedPreferences']);
12
12
  const handleAdvancedPreferences = (_, checked) => {
13
13
  setValue('advancedPreferences', checked);
@@ -11,7 +11,7 @@ export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
11
11
  selected?: boolean | undefined;
12
12
  size?: "small" | "medium" | "large" | undefined;
13
13
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
14
- value: unknown;
14
+ value: {};
15
15
  } & Omit<{
16
16
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
17
17
  centerRipple?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
- import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
3
+ import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import shallow from 'zustand/shallow';
6
6
  import { Card, CardTitle } from '../../components/Card';
@@ -8,16 +8,13 @@ import { Select } from '../../components/Select';
8
8
  import { useTools } from '../../hooks';
9
9
  import { useSettingsStore } from '../../stores';
10
10
  export const EnabledBridgesSelect = () => {
11
- var _a;
12
11
  const { t } = useTranslation();
13
12
  const { tools, formattedTools } = useTools();
14
13
  const [enabledBridges, setTools] = useSettingsStore((state) => [state.enabledBridges, state.setTools], shallow);
15
- return (tools === null || tools === void 0 ? void 0 : tools.bridges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledBridges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledBridges`), MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, value: enabledBridges !== null && enabledBridges !== void 0 ? enabledBridges : [], onChange: (event) => {
16
- if (tools === null || tools === void 0 ? void 0 : tools.bridges) {
17
- setTools('Bridges', event.target.value, tools.bridges);
18
- }
14
+ return (tools === null || tools === void 0 ? void 0 : tools.bridges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledBridges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledBridges`), MenuProps: { elevation: 2, PaperProps: { sx: { maxHeight: 320 } } }, IconComponent: KeyboardArrowDownIcon, value: enabledBridges !== null && enabledBridges !== void 0 ? enabledBridges : [], onChange: (event) => {
15
+ setTools('Bridges', event.target.value, tools.bridges);
19
16
  }, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
20
17
  var _a, _b, _c;
21
18
  return (_jsx(Chip, { label: (_c = (_b = (_a = formattedTools.bridges) === null || _a === void 0 ? void 0 : _a[value]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : value }, value));
22
- }) }))) }, { children: (_a = tools === null || tools === void 0 ? void 0 : tools.bridges) === null || _a === void 0 ? void 0 : _a.map((bridge) => (_jsx(MenuItem, Object.assign({ value: bridge.key }, { children: bridge.name }), bridge.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 134, sx: { borderRadius: 1 } }));
19
+ }) }))) }, { children: tools.bridges.map((bridge) => (_jsxs(MenuItem, Object.assign({ value: bridge.key, sx: { paddingTop: 0, paddingBottom: 0 } }, { children: [_jsx(Checkbox, { checked: enabledBridges === null || enabledBridges === void 0 ? void 0 : enabledBridges.includes(bridge.key) }), bridge.name] }), bridge.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 134, sx: { borderRadius: 1 } }));
23
20
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
- import { Box, Chip, FormControl, MenuItem, Skeleton } from '@mui/material';
3
+ import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import shallow from 'zustand/shallow';
6
6
  import { Card, CardTitle } from '../../components/Card';
@@ -12,11 +12,9 @@ export const EnabledExchangesSelect = () => {
12
12
  const { tools, formattedTools } = useTools();
13
13
  const [enabledExchanges, setTools] = useSettingsStore((state) => [state.enabledExchanges, state.setTools], shallow);
14
14
  return (tools === null || tools === void 0 ? void 0 : tools.exchanges.length) ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.enabledExchanges`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ multiple: true, placeholder: t(`settings.selectEnabledExchanges`), value: enabledExchanges !== null && enabledExchanges !== void 0 ? enabledExchanges : [], onChange: (event) => {
15
- if (tools === null || tools === void 0 ? void 0 : tools.exchanges) {
16
- setTools('Exchanges', event.target.value, tools.exchanges);
17
- }
18
- }, MenuProps: { elevation: 2 }, IconComponent: KeyboardArrowDownIcon, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
15
+ setTools('Exchanges', event.target.value, tools.exchanges);
16
+ }, MenuProps: { elevation: 2, PaperProps: { sx: { maxHeight: 320 } } }, IconComponent: KeyboardArrowDownIcon, renderValue: (selected) => (_jsx(Box, Object.assign({ sx: { display: 'flex', flexWrap: 'wrap', gap: 0.5 } }, { children: selected.map((value) => {
19
17
  var _a, _b, _c;
20
18
  return (_jsx(Chip, { label: (_c = (_b = (_a = formattedTools.exchanges) === null || _a === void 0 ? void 0 : _a[value]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : value }, value));
21
- }) }))) }, { children: tools === null || tools === void 0 ? void 0 : tools.exchanges.map((exchange) => (_jsx(MenuItem, Object.assign({ value: exchange.key }, { children: exchange.key }), exchange.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 206, sx: { borderRadius: 1 } }));
19
+ }) }))) }, { children: tools.exchanges.map((exchange) => (_jsxs(MenuItem, Object.assign({ value: exchange.key, sx: { paddingTop: 0, paddingBottom: 0 } }, { children: [_jsx(Checkbox, { checked: enabledExchanges === null || enabledExchanges === void 0 ? void 0 : enabledExchanges.includes(exchange.key) }), exchange.name] }), exchange.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 206, sx: { borderRadius: 1 } }));
22
20
  };
@@ -4,10 +4,10 @@ import { FormControl, MenuItem } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Card, CardTitle } from '../../components/Card';
6
6
  import { Select } from '../../components/Select';
7
- import { useSetSettings, useSettings } from '../../stores';
7
+ import { useSettings, useSettingsStore } from '../../stores';
8
8
  export const GasPriceSelect = () => {
9
9
  const { t } = useTranslation();
10
- const [setValue] = useSetSettings();
10
+ const setValue = useSettingsStore((state) => state.setValue);
11
11
  const { gasPrice } = useSettings(['gasPrice']);
12
12
  return (_jsxs(Card, Object.assign({ flex: 1 }, { children: [_jsx(CardTitle, { children: t(`settings.gasPrice.title`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsxs(Select, Object.assign({ MenuProps: { elevation: 2 }, value: gasPrice, onChange: (event) => setValue('gasPrice', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: [_jsx(MenuItem, Object.assign({ value: "slow" }, { children: t(`settings.gasPrice.slow`) })), _jsx(MenuItem, Object.assign({ value: "normal" }, { children: t(`settings.gasPrice.normal`) })), _jsx(MenuItem, Object.assign({ value: "fast" }, { children: t(`settings.gasPrice.fast`) }))] })) }))] })));
13
13
  };
@@ -5,10 +5,14 @@ import { FormControl, MenuItem } from '@mui/material';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Card, CardTitle } from '../../components/Card';
7
7
  import { Select } from '../../components/Select';
8
- import { useSetSettings, useSettings } from '../../stores';
8
+ import { useSettings, useSettingsStore } from '../../stores';
9
9
  export const RoutePrioritySelect = () => {
10
10
  const { t } = useTranslation();
11
- const [setValue] = useSetSettings();
11
+ const setValue = useSettingsStore((state) => state.setValue);
12
12
  const { routePriority } = useSettings(['routePriority']);
13
- return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.routePriority`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ MenuProps: { elevation: 2 }, value: routePriority, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: Orders.map((order) => (_jsx(MenuItem, Object.assign({ value: order }, { children: t(`swap.tags.${order.toLowerCase()}`) }), order))) })) }))] }));
13
+ return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.routePriority`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ MenuProps: { elevation: 2 }, value: routePriority, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true }, { children: Orders.map((order) => {
14
+ const tag = t(`swap.tags.${order.toUpperCase()}`);
15
+ const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
16
+ return (_jsx(MenuItem, Object.assign({ value: order }, { children: tagName }), order));
17
+ }) })) }))] }));
14
18
  };
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Typography } from '@mui/material';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { Switch } from '../../components/Switch';
5
- import { useSetSettings, useSettings } from '../../stores';
5
+ import { useSettings, useSettingsStore } from '../../stores';
6
6
  export const ShowDestinationWallet = () => {
7
7
  const { t } = useTranslation();
8
- const [setValue] = useSetSettings();
8
+ const setValue = useSettingsStore((state) => state.setValue);
9
9
  const { showDestinationWallet } = useSettings(['showDestinationWallet']);
10
10
  const onChange = (_, checked) => {
11
11
  setValue('showDestinationWallet', checked);
@@ -4,12 +4,12 @@ import { useRef } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Card, CardTitle } from '../../components/Card';
6
6
  import { Input } from '../../components/Input';
7
- import { useSetSettings, useSettings } from '../../stores';
7
+ import { useSettings, useSettingsStore } from '../../stores';
8
8
  import { formatSlippage } from '../../utils';
9
9
  export const SlippageInput = () => {
10
10
  const { t } = useTranslation();
11
- const [setValue] = useSetSettings();
12
11
  const { slippage } = useSettings(['slippage']);
12
+ const setValue = useSettingsStore((state) => state.setValue);
13
13
  const defaultValue = useRef(slippage);
14
14
  const handleChange = (event) => {
15
15
  const { value } = event.target;
@@ -16,7 +16,7 @@ import { useLocation } from 'react-router-dom';
16
16
  import shallow from 'zustand/shallow';
17
17
  import { Card, CardTitle } from '../../components/Card';
18
18
  import { Dialog } from '../../components/Dialog';
19
- import { useSetHeaderAction } from '../../components/Header';
19
+ import { useHeaderActionStore } from '../../components/Header';
20
20
  import { Step } from '../../components/Step';
21
21
  import { StepDivider } from '../../components/StepDivider';
22
22
  import { useNavigateBack } from '../../hooks';
@@ -26,7 +26,6 @@ export const SwapDetailsPage = () => {
26
26
  var _a, _b;
27
27
  const { t } = useTranslation();
28
28
  const { navigateBack } = useNavigateBack();
29
- const setHeaderAction = useSetHeaderAction();
30
29
  const { state } = useLocation();
31
30
  const [routeExecution, deleteRoute] = useRouteStore((store) => [store.routes[state === null || state === void 0 ? void 0 : state.routeId], store.deleteRoute], shallow);
32
31
  const [open, setOpen] = useState(false);
@@ -44,8 +43,8 @@ export const SwapDetailsPage = () => {
44
43
  yield navigator.clipboard.writeText((_c = routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.id) !== null && _c !== void 0 ? _c : '');
45
44
  });
46
45
  useEffect(() => {
47
- return setHeaderAction(_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: toggleDialog }, { children: _jsx(DeleteIcon, {}) })));
48
- }, [setHeaderAction, toggleDialog]);
46
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: toggleDialog }, { children: _jsx(DeleteIcon, {}) })));
47
+ }, [toggleDialog]);
49
48
  const startedAt = new Date((_b = (_a = routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps[0].execution) === null || _a === void 0 ? void 0 : _a.process[0].startedAt) !== null && _b !== void 0 ? _b : 0);
50
49
  return (_jsxs(Container, { children: [_jsxs(Box, Object.assign({ sx: {
51
50
  display: 'flex',
@@ -59,5 +58,5 @@ export const SwapDetailsPage = () => {
59
58
  }), _jsxs(Card, Object.assign({ mt: 2 }, { children: [_jsxs(Box, Object.assign({ sx: {
60
59
  display: 'flex',
61
60
  flex: 1,
62
- } }, { children: [_jsx(CardTitle, Object.assign({ flex: 1 }, { children: t('swap.routeId') })), _jsx(Box, Object.assign({ mr: 1, mt: 1 }, { children: _jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", onClick: copyRouteId }, { children: _jsx(ContentCopyIcon, { fontSize: "small" }) })) }))] })), _jsx(Typography, Object.assign({ variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' } }, { children: routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.id }))] })), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(Button, Object.assign({ variant: "contained", href: "https://discord.com/channels/849912621360218112/863689862514343946", target: "_blank", rel: "nofollow noreferrer", fullWidth: true }, { children: t('button.contactSupport') })) })), _jsxs(Dialog, Object.assign({ open: open, onClose: toggleDialog }, { children: [_jsx(DialogTitle, { children: t('swap.warning.title.deleteSwap') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('swap.warning.message.deleteSwap') }) }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ onClick: toggleDialog }, { children: t('button.cancel') })), _jsx(Button, Object.assign({ onClick: handleDeleteRoute, autoFocus: true }, { children: t('button.delete') }))] })] }))] }));
61
+ } }, { children: [_jsx(CardTitle, Object.assign({ flex: 1 }, { children: t('swap.supportId') })), _jsx(Box, Object.assign({ mr: 1, mt: 1 }, { children: _jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", onClick: copyRouteId }, { children: _jsx(ContentCopyIcon, { fontSize: "small" }) })) }))] })), _jsx(Typography, Object.assign({ variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' } }, { children: routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.id }))] })), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(Button, Object.assign({ variant: "contained", href: "https://discord.com/channels/849912621360218112/863689862514343946", target: "_blank", rel: "nofollow noreferrer", fullWidth: true }, { children: t('button.contactSupport') })) })), _jsxs(Dialog, Object.assign({ open: open, onClose: toggleDialog }, { children: [_jsx(DialogTitle, { children: t('swap.warning.title.deleteSwap') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('swap.warning.message.deleteSwap') }) }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ onClick: toggleDialog }, { children: t('button.cancel') })), _jsx(Button, Object.assign({ onClick: handleDeleteRoute, autoFocus: true }, { children: t('button.delete') }))] })] }))] }));
63
62
  };
@@ -4,7 +4,7 @@ import { Button, Container, DialogActions, DialogContent, DialogContentText, Dia
4
4
  import { useCallback, useEffect, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Dialog } from '../../components/Dialog';
7
- import { useSetHeaderAction } from '../../components/Header';
7
+ import { useHeaderActionStore } from '../../components/Header';
8
8
  import { useWallet } from '../../providers';
9
9
  import { useRouteStore } from '../../stores';
10
10
  import { useSwapHistory } from '../../stores/route';
@@ -15,14 +15,13 @@ export const SwapHistoryPage = () => {
15
15
  const { account } = useWallet();
16
16
  const swaps = useSwapHistory(account.address);
17
17
  const deleteRoutes = useRouteStore((store) => store.deleteRoutes);
18
- const setHeaderAction = useSetHeaderAction();
19
18
  const [open, setOpen] = useState(false);
20
19
  const toggleDialog = useCallback(() => {
21
20
  setOpen((open) => !open);
22
21
  }, []);
23
22
  useEffect(() => {
24
- return setHeaderAction(_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: toggleDialog }, { children: _jsx(DeleteIcon, {}) })));
25
- }, [setHeaderAction, toggleDialog]);
23
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "settings", edge: "end", onClick: toggleDialog }, { children: _jsx(DeleteIcon, {}) })));
24
+ }, [toggleDialog]);
26
25
  if (!swaps.length) {
27
26
  return _jsx(SwapHistoryEmpty, {});
28
27
  }