@lifi/widget 1.17.2 → 1.18.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 (211) hide show
  1. package/App.js +6 -86
  2. package/AppDrawer.js +3 -2
  3. package/AppRoutes.d.ts +2 -0
  4. package/AppRoutes.js +85 -0
  5. package/cjs/App.js +5 -85
  6. package/cjs/AppDrawer.js +2 -1
  7. package/cjs/AppRoutes.d.ts +2 -0
  8. package/cjs/AppRoutes.js +89 -0
  9. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -0
  10. package/cjs/components/AppContainer.d.ts +4 -5
  11. package/cjs/components/AppContainer.js +30 -29
  12. package/cjs/components/Card/Card.d.ts +1 -0
  13. package/cjs/components/Card/Card.js +13 -9
  14. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -0
  15. package/cjs/components/ChainSelect/ChainSelect.js +3 -3
  16. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  17. package/cjs/components/ChainSelect/ChainSelect.style.js +2 -2
  18. package/cjs/components/ChainSelect/useChainSelect.js +2 -2
  19. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  20. package/cjs/components/Header/Header.d.ts +2 -1
  21. package/cjs/components/Header/Header.js +3 -2
  22. package/cjs/components/Header/Header.style.js +3 -2
  23. package/cjs/components/Header/NavigationHeader.js +4 -1
  24. package/cjs/components/Header/WalletHeader.js +1 -1
  25. package/cjs/components/PoweredBy/PoweredBy.js +7 -0
  26. package/cjs/components/SendToWallet/SendToWallet.js +6 -10
  27. package/cjs/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  28. package/cjs/components/SendToWallet/SendToWalletButton.js +24 -0
  29. package/cjs/components/SendToWallet/index.d.ts +1 -0
  30. package/cjs/components/SendToWallet/index.js +1 -0
  31. package/cjs/components/SendToWallet/store.d.ts +4 -0
  32. package/cjs/components/SendToWallet/store.js +13 -0
  33. package/cjs/components/SendToWallet/types.d.ts +6 -0
  34. package/cjs/{stores/route → components/SendToWallet}/types.js +0 -0
  35. package/cjs/components/Step/CircularProgress.d.ts +1 -0
  36. package/cjs/components/StepActions/StepActions.style.js +1 -1
  37. package/cjs/components/SwapButton/ButtonTooltip.d.ts +1 -0
  38. package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
  39. package/cjs/components/SwapButton/SwapButton.js +4 -4
  40. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  41. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  42. package/cjs/components/SwapRouteCard/SwapRouteCard.js +19 -15
  43. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  44. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +16 -3
  45. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  46. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  47. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  48. package/cjs/components/SwapRouteCard/types.d.ts +6 -2
  49. package/cjs/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  50. package/cjs/components/SwapRoutes/SwapRoutes.js +51 -0
  51. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  52. package/cjs/components/SwapRoutes/SwapRoutes.style.js +47 -0
  53. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  54. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +38 -0
  55. package/cjs/components/SwapRoutes/index.d.ts +2 -0
  56. package/cjs/components/SwapRoutes/index.js +18 -0
  57. package/cjs/components/Token/Token.d.ts +2 -1
  58. package/cjs/components/Token/Token.js +10 -6
  59. package/cjs/components/Token/Token.style.js +2 -0
  60. package/cjs/config/theme.js +20 -24
  61. package/cjs/config/version.d.ts +1 -1
  62. package/cjs/config/version.js +1 -1
  63. package/cjs/hooks/useChains.js +2 -2
  64. package/cjs/hooks/useNavigateBack.js +13 -6
  65. package/cjs/hooks/useRouteExecution.js +4 -4
  66. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  67. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  68. package/cjs/pages/MainPage/MainPage.js +4 -2
  69. package/cjs/pages/MainPage/MainSwapButton.js +4 -4
  70. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  71. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  72. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  73. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  74. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  75. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -0
  76. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  77. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -0
  78. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  79. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  80. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  81. package/cjs/pages/SwapPage/SwapPage.js +5 -1
  82. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  83. package/cjs/providers/WalletProvider/WalletProvider.js +2 -2
  84. package/cjs/stores/index.d.ts +2 -1
  85. package/cjs/stores/index.js +2 -1
  86. package/cjs/stores/{route → routes}/index.d.ts +2 -1
  87. package/cjs/stores/{route → routes}/index.js +2 -1
  88. package/cjs/stores/{route → routes}/types.d.ts +4 -0
  89. package/cjs/stores/routes/types.js +2 -0
  90. package/cjs/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  91. package/cjs/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  92. package/cjs/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  93. package/cjs/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +2 -2
  94. package/cjs/stores/routes/useSelectedRouteStore.d.ts +4 -0
  95. package/cjs/stores/routes/useSelectedRouteStore.js +12 -0
  96. package/cjs/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  97. package/cjs/stores/{route → routes}/useSetExecutableRoute.js +2 -2
  98. package/cjs/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  99. package/cjs/stores/{route → routes}/useSwapHistory.js +2 -2
  100. package/cjs/stores/{route → routes}/utils.d.ts +0 -0
  101. package/cjs/stores/{route → routes}/utils.js +0 -0
  102. package/cjs/stores/settings/useSettingsStore.js +1 -1
  103. package/cjs/types/widget.d.ts +2 -0
  104. package/cjs/utils/colors.d.ts +1 -1
  105. package/cjs/utils/navigationRoutes.js +12 -12
  106. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -0
  107. package/components/AppContainer.d.ts +4 -5
  108. package/components/AppContainer.js +29 -28
  109. package/components/Card/Card.d.ts +1 -0
  110. package/components/Card/Card.js +13 -9
  111. package/components/ChainSelect/ChainSelect.d.ts +1 -0
  112. package/components/ChainSelect/ChainSelect.js +1 -1
  113. package/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  114. package/components/ChainSelect/ChainSelect.style.js +2 -2
  115. package/components/ChainSelect/useChainSelect.js +1 -1
  116. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  117. package/components/Header/Header.d.ts +2 -1
  118. package/components/Header/Header.js +1 -1
  119. package/components/Header/Header.style.js +4 -3
  120. package/components/Header/NavigationHeader.js +4 -1
  121. package/components/Header/WalletHeader.js +2 -2
  122. package/components/PoweredBy/PoweredBy.js +7 -0
  123. package/components/SendToWallet/SendToWallet.js +8 -11
  124. package/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  125. package/components/SendToWallet/SendToWalletButton.js +20 -0
  126. package/components/SendToWallet/index.d.ts +1 -0
  127. package/components/SendToWallet/index.js +1 -0
  128. package/components/SendToWallet/store.d.ts +4 -0
  129. package/components/SendToWallet/store.js +10 -0
  130. package/components/SendToWallet/types.d.ts +6 -0
  131. package/{stores/route → components/SendToWallet}/types.js +0 -0
  132. package/components/Step/CircularProgress.d.ts +1 -0
  133. package/components/StepActions/StepActions.style.js +1 -1
  134. package/components/SwapButton/ButtonTooltip.d.ts +1 -0
  135. package/components/SwapButton/SwapButton.d.ts +1 -1
  136. package/components/SwapButton/SwapButton.js +4 -3
  137. package/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  138. package/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  139. package/components/SwapRouteCard/SwapRouteCard.js +19 -16
  140. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  141. package/components/SwapRouteCard/SwapRouteCard.style.js +17 -4
  142. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  143. package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  144. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  145. package/components/SwapRouteCard/types.d.ts +6 -2
  146. package/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  147. package/components/SwapRoutes/SwapRoutes.js +47 -0
  148. package/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  149. package/components/SwapRoutes/SwapRoutes.style.js +44 -0
  150. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  151. package/components/SwapRoutes/SwapRoutesExpanded.js +34 -0
  152. package/components/SwapRoutes/index.d.ts +2 -0
  153. package/components/SwapRoutes/index.js +2 -0
  154. package/components/Token/Token.d.ts +2 -1
  155. package/components/Token/Token.js +11 -7
  156. package/components/Token/Token.style.js +2 -0
  157. package/config/theme.js +20 -24
  158. package/config/version.d.ts +1 -1
  159. package/config/version.js +1 -1
  160. package/hooks/useChains.js +1 -1
  161. package/hooks/useNavigateBack.js +13 -6
  162. package/hooks/useRouteExecution.js +5 -5
  163. package/package.json +11 -11
  164. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  165. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  166. package/pages/MainPage/MainPage.js +4 -2
  167. package/pages/MainPage/MainSwapButton.js +4 -3
  168. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  169. package/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  170. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  171. package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  172. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  173. package/pages/SettingsPage/SettingsPage.d.ts +1 -0
  174. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  175. package/pages/SettingsPage/SlippageInput.d.ts +1 -0
  176. package/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
  177. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  178. package/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  179. package/pages/SwapPage/SwapPage.js +5 -1
  180. package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  181. package/providers/WalletProvider/WalletProvider.js +1 -1
  182. package/stores/index.d.ts +2 -1
  183. package/stores/index.js +2 -1
  184. package/stores/{route → routes}/index.d.ts +2 -1
  185. package/stores/{route → routes}/index.js +2 -1
  186. package/stores/{route → routes}/types.d.ts +4 -0
  187. package/stores/routes/types.js +1 -0
  188. package/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  189. package/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  190. package/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  191. package/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +1 -1
  192. package/stores/routes/useSelectedRouteStore.d.ts +4 -0
  193. package/stores/routes/useSelectedRouteStore.js +9 -0
  194. package/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  195. package/stores/routes/useSetExecutableRoute.js +4 -0
  196. package/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  197. package/stores/{route → routes}/useSwapHistory.js +2 -2
  198. package/stores/{route → routes}/utils.d.ts +0 -0
  199. package/stores/{route → routes}/utils.js +0 -0
  200. package/stores/settings/useSettingsStore.js +1 -1
  201. package/tsconfig.cjs.tsbuildinfo +1 -1
  202. package/types/widget.d.ts +2 -0
  203. package/utils/colors.d.ts +1 -1
  204. package/utils/navigationRoutes.js +12 -12
  205. package/cjs/pages/MainPage/SwapRoutes.js +0 -43
  206. package/cjs/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  207. package/cjs/pages/MainPage/SwapRoutes.style.js +0 -16
  208. package/pages/MainPage/SwapRoutes.js +0 -39
  209. package/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  210. package/pages/MainPage/SwapRoutes.style.js +0 -13
  211. package/stores/route/useSetExecutableRoute.js +0 -4
@@ -14,7 +14,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
14
14
  const wallet_management_1 = require("@lifi/wallet-management");
15
15
  const react_1 = require("react");
16
16
  const react_hook_form_1 = require("react-hook-form");
17
- const chains_1 = require("../../stores/chains");
17
+ const stores_1 = require("../../stores");
18
18
  const SwapFormProvider_1 = require("../SwapFormProvider");
19
19
  const WidgetProvider_1 = require("../WidgetProvider");
20
20
  const stub = () => {
@@ -112,7 +112,7 @@ const WalletProvider = ({ children }) => {
112
112
  const { isDirty: isToChainDirty } = methods.getFieldState(SwapFormProvider_1.SwapFormKey.ToChain, methods.formState);
113
113
  const { isDirty: isFromTokenDirty } = methods.getFieldState(SwapFormProvider_1.SwapFormKey.FromToken, methods.formState);
114
114
  const { isDirty: isToTokenDirty } = methods.getFieldState(SwapFormProvider_1.SwapFormKey.ToToken, methods.formState);
115
- const { chainOrder, setChain } = chains_1.useChainOrderStore.getState();
115
+ const { chainOrder, setChain } = stores_1.useChainOrderStore.getState();
116
116
  // Users can switch chains in the wallet.
117
117
  // If we don't have a chain in the ordered chain list we should add it.
118
118
  setChain(account.chainId);
@@ -1,2 +1,3 @@
1
- export * from './route';
1
+ export * from './chains';
2
+ export * from './routes';
2
3
  export * from './settings';
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./route"), exports);
17
+ __exportStar(require("./chains"), exports);
18
+ __exportStar(require("./routes"), exports);
18
19
  __exportStar(require("./settings"), exports);
@@ -1,6 +1,7 @@
1
1
  export * from './types';
2
2
  export * from './useExecutingRoutesIds';
3
- export * from './useRouteStore';
3
+ export * from './useRouteExecutionStore';
4
+ export * from './useSelectedRouteStore';
4
5
  export * from './useSetExecutableRoute';
5
6
  export * from './useSwapHistory';
6
7
  export * from './utils';
@@ -16,7 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
18
  __exportStar(require("./useExecutingRoutesIds"), exports);
19
- __exportStar(require("./useRouteStore"), exports);
19
+ __exportStar(require("./useRouteExecutionStore"), exports);
20
+ __exportStar(require("./useSelectedRouteStore"), exports);
20
21
  __exportStar(require("./useSetExecutableRoute"), exports);
21
22
  __exportStar(require("./useSwapHistory"), exports);
22
23
  __exportStar(require("./utils"), exports);
@@ -12,3 +12,7 @@ export interface RouteExecution {
12
12
  route: Route;
13
13
  status: RouteExecutionStatus;
14
14
  }
15
+ export interface SelectedRouteStore {
16
+ selectedRoute?: Route;
17
+ setSelectedRoute: (route?: Route) => void;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useExecutingRoutesIds = void 0;
4
4
  const shallow_1 = require("zustand/shallow");
5
- const useRouteStore_1 = require("./useRouteStore");
5
+ const useRouteExecutionStore_1 = require("./useRouteExecutionStore");
6
6
  const useExecutingRoutesIds = (address) => {
7
- return (0, useRouteStore_1.useRouteStore)((state) => Object.values(state.routes)
7
+ return (0, useRouteExecutionStore_1.useRouteExecutionStore)((state) => Object.values(state.routes)
8
8
  .filter((item) => item.route.fromAddress === address &&
9
9
  (item.status === 'loading' || item.status === 'error'))
10
10
  .sort((a, b) => {
@@ -1,5 +1,5 @@
1
1
  import type { RouteExecutionStore } from './types';
2
- export declare const useRouteStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<RouteExecutionStore>, "persist"> & {
2
+ export declare const useRouteExecutionStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<RouteExecutionStore>, "persist"> & {
3
3
  persist: {
4
4
  setOptions: (options: Partial<import("zustand/middleware").PersistOptions<RouteExecutionStore, {
5
5
  routes: Partial<Record<string, import("./types").RouteExecution>>;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useRouteStore = void 0;
3
+ exports.useRouteExecutionStore = void 0;
4
4
  const zustand_1 = require("zustand");
5
5
  const middleware_1 = require("zustand/middleware");
6
6
  const immer_1 = require("zustand/middleware/immer");
7
7
  const utils_1 = require("./utils");
8
- exports.useRouteStore = (0, zustand_1.default)()((0, middleware_1.persist)((0, immer_1.immer)((set) => ({
8
+ exports.useRouteExecutionStore = (0, zustand_1.default)()((0, middleware_1.persist)((0, immer_1.immer)((set) => ({
9
9
  routes: {},
10
10
  setExecutableRoute: (route) => set((state) => {
11
11
  if (!state.routes[route.id]) {
@@ -0,0 +1,4 @@
1
+ import type { SelectedRouteStore } from './types';
2
+ export declare const useSelectedRouteStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SelectedRouteStore>, "setState"> & {
3
+ setState(nextStateOrUpdater: SelectedRouteStore | Partial<SelectedRouteStore> | ((state: import("immer/dist/internal").WritableDraft<SelectedRouteStore>) => void), shouldReplace?: boolean | undefined): void;
4
+ }>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSelectedRouteStore = void 0;
4
+ const zustand_1 = require("zustand");
5
+ const immer_1 = require("zustand/middleware/immer");
6
+ exports.useSelectedRouteStore = (0, zustand_1.default)()((0, immer_1.immer)((set) => ({
7
+ setSelectedRoute: (route) => {
8
+ set((state) => {
9
+ state.selectedRoute = route;
10
+ });
11
+ },
12
+ })));
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSetExecutableRoute = void 0;
4
- const useRouteStore_1 = require("./useRouteStore");
4
+ const useRouteExecutionStore_1 = require("./useRouteExecutionStore");
5
5
  const useSetExecutableRoute = () => {
6
- return (0, useRouteStore_1.useRouteStore)((state) => state.setExecutableRoute);
6
+ return (0, useRouteExecutionStore_1.useRouteExecutionStore)((state) => state.setExecutableRoute);
7
7
  };
8
8
  exports.useSetExecutableRoute = useSetExecutableRoute;
File without changes
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useSwapHistory = void 0;
4
4
  const shallow_1 = require("zustand/shallow");
5
- const useRouteStore_1 = require("./useRouteStore");
5
+ const useRouteExecutionStore_1 = require("./useRouteExecutionStore");
6
6
  const useSwapHistory = (address) => {
7
- return (0, useRouteStore_1.useRouteStore)((state) => Object.values(state.routes)
7
+ return (0, useRouteExecutionStore_1.useRouteExecutionStore)((state) => Object.values(state.routes)
8
8
  .filter((item) => (item === null || item === void 0 ? void 0 : item.route.fromAddress) === address && (item === null || item === void 0 ? void 0 : item.status) === 'success')
9
9
  .sort((a, b) => {
10
10
  var _a, _b, _c, _d;
File without changes
File without changes
@@ -19,7 +19,7 @@ const immer_1 = require("zustand/middleware/immer");
19
19
  const types_1 = require("./types");
20
20
  exports.useSettingsStore = (0, zustand_1.default)()((0, middleware_1.persist)((0, immer_1.immer)((set) => ({
21
21
  advancedPreferences: false,
22
- showDestinationWallet: false,
22
+ showDestinationWallet: true,
23
23
  appearance: 'auto',
24
24
  gasPrice: 'normal',
25
25
  routePriority: 'RECOMMENDED',
@@ -3,6 +3,7 @@ import type { PaletteMode, PaletteOptions, Shape } from '@mui/material';
3
3
  import type { TypographyOptions } from '@mui/material/styles/createTypography';
4
4
  import type { Signer } from 'ethers';
5
5
  import type { CSSProperties } from 'react';
6
+ export declare type WidgetVariant = 'default' | 'expandable' | 'drawer';
6
7
  export declare type Appearance = PaletteMode | 'auto';
7
8
  export declare type ThemeConfig = {
8
9
  palette?: Pick<PaletteOptions, 'primary' | 'secondary'>;
@@ -34,6 +35,7 @@ export interface WidgetConfig {
34
35
  /** @deprecated Use tokens.featured instead */
35
36
  featuredTokens?: Token[];
36
37
  integrator?: string;
38
+ variant?: WidgetVariant;
37
39
  walletManagement?: WidgetWalletManagement;
38
40
  sdkConfig?: ConfigUpdate;
39
41
  bridges?: {
@@ -1,3 +1,3 @@
1
1
  import type { Theme } from '@mui/material';
2
2
  export declare const getContrastAlphaColor: (theme: Theme, alpha: string | number) => string;
3
- export declare const getContrastTextColor: (theme: Theme, background?: string) => "#000" | "#fff";
3
+ export declare const getContrastTextColor: (theme: Theme, background?: string) => "#fff" | "#000";
@@ -17,26 +17,26 @@ exports.navigationRoutes = {
17
17
  };
18
18
  exports.navigationRoutesValues = Object.values(exports.navigationRoutes);
19
19
  exports.stickyHeaderRoutes = [
20
- exports.navigationRoutes.selectWallet,
20
+ exports.navigationRoutes.activeSwaps,
21
21
  exports.navigationRoutes.fromChain,
22
- exports.navigationRoutes.toChain,
22
+ exports.navigationRoutes.selectWallet,
23
23
  exports.navigationRoutes.settings,
24
- exports.navigationRoutes.swapRoutes,
24
+ exports.navigationRoutes.swapDetails,
25
25
  exports.navigationRoutes.swapExecution,
26
26
  exports.navigationRoutes.swapHistory,
27
- exports.navigationRoutes.activeSwaps,
28
- exports.navigationRoutes.swapDetails,
27
+ exports.navigationRoutes.swapRoutes,
28
+ exports.navigationRoutes.toChain,
29
29
  ];
30
30
  exports.backButtonRoutes = [
31
+ exports.navigationRoutes.activeSwaps,
32
+ exports.navigationRoutes.fromChain,
33
+ exports.navigationRoutes.fromToken,
31
34
  exports.navigationRoutes.selectWallet,
32
35
  exports.navigationRoutes.settings,
36
+ exports.navigationRoutes.swapDetails,
37
+ exports.navigationRoutes.swapExecution,
33
38
  exports.navigationRoutes.swapHistory,
34
- exports.navigationRoutes.activeSwaps,
35
- exports.navigationRoutes.fromToken,
36
- exports.navigationRoutes.toToken,
37
- exports.navigationRoutes.fromChain,
38
- exports.navigationRoutes.toChain,
39
39
  exports.navigationRoutes.swapRoutes,
40
- exports.navigationRoutes.swapExecution,
41
- exports.navigationRoutes.swapDetails,
40
+ exports.navigationRoutes.toChain,
41
+ exports.navigationRoutes.toToken,
42
42
  ];
@@ -8,6 +8,7 @@ export declare const ProgressCard: import("@emotion/styled").StyledComponent<imp
8
8
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
9
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("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") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
10
  variant?: ("default" | "error" | "selected") | undefined;
11
+ selectionColor?: "primary" | "secondary" | undefined;
11
12
  dense?: boolean | undefined;
12
13
  indented?: boolean | undefined;
13
14
  onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -1,4 +1,5 @@
1
- import type { PropsWithChildren, RefObject } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ export declare const maxHeight = 680;
2
3
  export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
3
4
  children?: import("react").ReactNode;
4
5
  classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
@@ -7,9 +8,7 @@ export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
7
8
  maxWidth?: false | import("@mui/material").Breakpoint | undefined;
8
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
10
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
10
- ref?: RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
12
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
12
13
  export declare const AppContainer: React.FC<PropsWithChildren<{}>>;
13
- export declare const ScrollToLocation: React.FC<{
14
- elementRef: RefObject<HTMLElement>;
15
- }>;
14
+ export declare const AppExpandedContainer: React.FC<PropsWithChildren<{}>>;
@@ -1,54 +1,55 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Box, Container, ScopedCssBaseline } from '@mui/material';
3
3
  import { styled } from '@mui/material/styles';
4
- import { useLayoutEffect, useRef } from 'react';
5
- import { useLocation } from 'react-router-dom';
6
4
  import { useWidgetConfig } from '../providers';
7
5
  import { ElementId } from '../utils';
8
- const CssBaselineContainer = styled(ScopedCssBaseline)(({ theme }) => ({
9
- // height: '100%',
6
+ export const maxHeight = 680;
7
+ const ExpandedContainer = styled(Box, {
8
+ shouldForwardProp: (prop) => prop !== 'variant',
9
+ })(({ variant }) => ({
10
10
  display: 'flex',
11
+ justifyContent: 'center',
12
+ alignItems: 'start',
11
13
  flex: 1,
12
- flexDirection: 'column',
13
- overflowX: 'clip',
14
- marginRight: 0,
15
- width: '100%',
14
+ height: variant === 'drawer' ? 'none' : maxHeight,
16
15
  }));
17
- const RelativeContainer = styled(Box)(({ theme }) => ({
16
+ const RelativeContainer = styled(Box, {
17
+ shouldForwardProp: (prop) => prop !== 'variant',
18
+ })(({ theme, variant }) => ({
18
19
  position: 'relative',
19
20
  width: '100%',
20
21
  minWidth: 375,
21
22
  maxWidth: 392,
23
+ maxHeight: variant === 'drawer' ? 'none' : maxHeight,
22
24
  background: theme.palette.background.default,
23
25
  overflow: 'auto',
24
26
  flex: 1,
25
27
  boxSizing: 'border-box',
26
28
  zIndex: 0,
27
29
  }));
28
- const ScrollableContainer = styled(Box)({
29
- // position: 'fixed',
30
+ const CssBaselineContainer = styled(ScopedCssBaseline, {
31
+ shouldForwardProp: (prop) => prop !== 'variant',
32
+ })(({ variant }) => ({
33
+ display: 'flex',
34
+ flex: 1,
35
+ flexDirection: 'column',
36
+ overflowX: 'clip',
37
+ margin: 0,
38
+ width: '100%',
39
+ maxHeight: variant === 'drawer' ? 'none' : maxHeight,
30
40
  overflowY: 'auto',
31
41
  height: '100%',
32
- flex: 1,
33
- display: 'flex',
34
- });
42
+ }));
35
43
  export const FlexContainer = styled(Container)({
36
44
  display: 'flex',
37
- flexBasis: 'auto',
38
45
  flexDirection: 'column',
39
- flexShrink: 0,
40
- flexGrow: 1,
46
+ flex: 1,
41
47
  });
42
48
  export const AppContainer = ({ children }) => {
43
- const ref = useRef(null);
44
- const { containerStyle } = useWidgetConfig();
45
- return (_jsxs(RelativeContainer, Object.assign({ sx: containerStyle }, { children: [_jsx(ScrollableContainer, Object.assign({ id: ElementId.ScrollableContainer, ref: ref }, { children: _jsx(CssBaselineContainer, Object.assign({ enableColorScheme: true }, { children: _jsx(FlexContainer, Object.assign({ disableGutters: true }, { children: children })) })) })), _jsx(ScrollToLocation, { elementRef: ref })] })));
49
+ // const ref = useRef<HTMLDivElement>(null);
50
+ const { containerStyle, variant } = useWidgetConfig();
51
+ return (_jsx(RelativeContainer, Object.assign({ sx: containerStyle, variant: variant }, { children: _jsx(CssBaselineContainer, Object.assign({ id: ElementId.ScrollableContainer, variant: variant, enableColorScheme: true }, { children: _jsx(FlexContainer, Object.assign({ disableGutters: true }, { children: children })) })) })));
46
52
  };
47
- export const ScrollToLocation = ({ elementRef }) => {
48
- const { pathname } = useLocation();
49
- useLayoutEffect(() => {
50
- var _a;
51
- (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
52
- }, [elementRef, pathname]);
53
- return null;
53
+ export const AppExpandedContainer = ({ children, }) => {
54
+ return _jsx(ExpandedContainer, { children: children });
54
55
  };
@@ -10,6 +10,7 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
10
10
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
11
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("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") | "component"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
12
12
  variant?: CardVariant | undefined;
13
+ selectionColor?: "primary" | "secondary" | undefined;
13
14
  dense?: boolean | undefined;
14
15
  indented?: boolean | undefined;
15
16
  onClick?: MouseEventHandler<HTMLDivElement> | undefined;
@@ -1,21 +1,25 @@
1
1
  import { Box } from '@mui/material';
2
2
  import { alpha, darken, lighten, styled } from '@mui/material/styles';
3
- const getBackgroundColor = (theme, variant) => variant === 'selected'
4
- ? theme.palette.mode === 'light'
5
- ? alpha(theme.palette.primary.main, 0.04)
6
- : alpha(theme.palette.primary.main, 0.42)
3
+ const getBackgroundColor = (theme, variant, selectionColor) => variant === 'selected'
4
+ ? selectionColor === 'primary'
5
+ ? theme.palette.mode === 'light'
6
+ ? alpha(theme.palette.primary.main, 0.04)
7
+ : alpha(theme.palette.primary.main, 0.42)
8
+ : alpha(theme.palette.secondary.main, 0.08)
7
9
  : theme.palette.background.paper;
8
10
  export const Card = styled(Box, {
9
- shouldForwardProp: (prop) => !['dense', 'variant', 'indented'].includes(prop),
10
- })(({ theme, variant, dense, indented, onClick }) => {
11
- const backgroundColor = getBackgroundColor(theme, variant);
11
+ shouldForwardProp: (prop) => !['dense', 'variant', 'indented', 'selectionColor'].includes(prop),
12
+ })(({ theme, variant, selectionColor = 'primary', dense, indented, onClick, }) => {
13
+ const backgroundColor = getBackgroundColor(theme, variant, selectionColor);
12
14
  return {
13
15
  backgroundColor,
14
16
  border: `1px solid`,
15
17
  borderColor: variant === 'error'
16
18
  ? theme.palette.error.main
17
19
  : variant === 'selected'
18
- ? theme.palette.primary.main
20
+ ? selectionColor === 'primary'
21
+ ? theme.palette.primary.main
22
+ : alpha(theme.palette.secondary.main, 0.48)
19
23
  : theme.palette.mode === 'light'
20
24
  ? theme.palette.grey[300]
21
25
  : theme.palette.grey[800],
@@ -32,7 +36,7 @@ export const Card = styled(Box, {
32
36
  ? theme.palette.mode === 'light'
33
37
  ? darken(backgroundColor, 0.02)
34
38
  : lighten(backgroundColor, 0.02)
35
- : theme.palette.background.paper,
39
+ : backgroundColor,
36
40
  },
37
41
  transition: theme.transitions.create(['background-color'], {
38
42
  duration: theme.transitions.duration.enteringScreen,
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { SwapFormTypeProps } from '../../providers';
2
3
  export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -3,7 +3,7 @@ import { Avatar, Box, Skeleton, Typography } from '@mui/material';
3
3
  import { useWatch } from 'react-hook-form';
4
4
  import { useNavigate } from 'react-router-dom';
5
5
  import { SwapFormKeyHelper } from '../../providers';
6
- import { maxChainToOrder } from '../../stores/chains';
6
+ import { maxChainToOrder } from '../../stores';
7
7
  import { navigationRoutes } from '../../utils';
8
8
  import { ChainCard, ChainContainer } from './ChainSelect.style';
9
9
  import { useChainSelect } from './useChainSelect';
@@ -8,6 +8,7 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
8
8
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
9
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("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") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
10
  variant?: ("default" | "error" | "selected") | undefined;
11
+ selectionColor?: "primary" | "secondary" | undefined;
11
12
  dense?: boolean | undefined;
12
13
  indented?: boolean | undefined;
13
14
  onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -4,12 +4,12 @@ import { Card } from '../../components/Card';
4
4
  export const ChainCard = styled(Card)({
5
5
  display: 'grid',
6
6
  placeItems: 'center',
7
- minWidth: 56,
7
+ minWidth: 52,
8
8
  height: 56,
9
9
  });
10
10
  export const ChainContainer = styled(Box)(({ theme }) => ({
11
11
  display: 'grid',
12
- gridTemplateColumns: 'repeat(auto-fit, minmax(56px, 1fr))',
12
+ gridTemplateColumns: 'repeat(auto-fit, minmax(52px, 1fr))',
13
13
  gridAutoRows: '56px',
14
14
  justifyContent: 'space-between',
15
15
  gap: theme.spacing(1.5),
@@ -1,7 +1,7 @@
1
1
  import { useFormContext } from 'react-hook-form';
2
2
  import { useChains } from '../../hooks';
3
3
  import { SwapFormKey, SwapFormKeyHelper } from '../../providers';
4
- import { useChainOrder } from '../../stores/chains';
4
+ import { useChainOrder } from '../../stores';
5
5
  export const useChainSelect = (formType) => {
6
6
  const { setValue } = useFormContext();
7
7
  const { chains, isLoading } = useChains();
@@ -14,12 +14,14 @@ import { WarningAmber as WarningIcon } from '@mui/icons-material';
14
14
  import { Box, Typography } from '@mui/material';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useGasSufficiency } from '../../hooks';
17
+ import { useSelectedRouteStore } from '../../stores';
17
18
  import { CardTitle } from '../Card';
18
19
  import { MessageCard } from './GasSufficiencyMessage.style';
19
20
  export const GasSufficiencyMessage = (_a) => {
20
21
  var { route } = _a, props = __rest(_a, ["route"]);
21
22
  const { t } = useTranslation();
22
- const { insufficientFunds, insufficientGas } = useGasSufficiency(route);
23
+ const selectedRoute = useSelectedRouteStore((state) => state.selectedRoute);
24
+ const { insufficientFunds, insufficientGas } = useGasSufficiency(route !== null && route !== void 0 ? route : selectedRoute);
23
25
  if (!insufficientFunds && !(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)) {
24
26
  return null;
25
27
  }
@@ -31,7 +33,9 @@ export const GasSufficiencyMessage = (_a) => {
31
33
  : null }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? (_jsx(Typography, Object.assign({ variant: "body2", px: 2, pt: 1 }, { children: t(`swap.warning.message.insufficientGas`) }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)
32
34
  ? insufficientGas.map((item, index) => {
33
35
  var _a, _b;
34
- return (_jsx(Typography, Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length - 1 === index ? 2 : 0, pt: 0.5 }, { children: t(`swap.tokenOnChainAmount`, {
36
+ return (_jsx(Typography
37
+ // eslint-disable-next-line react/no-array-index-key
38
+ , Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length - 1 === index ? 2 : 0, pt: 0.5 }, { children: t(`swap.tokenOnChainAmount`, {
35
39
  amount: (_a = item.insufficientAmount) === null || _a === void 0 ? void 0 : _a.toString(),
36
40
  tokenSymbol: item.token.symbol,
37
41
  chainName: (_b = item.chain) === null || _b === void 0 ? void 0 : _b.name,
@@ -1,2 +1,3 @@
1
- import type { FC } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ export declare const HeaderContainer: FC<PropsWithChildren<{}>>;
2
3
  export declare const Header: FC;
@@ -5,7 +5,7 @@ import { ElementId, stickyHeaderRoutes } from '../../utils';
5
5
  import { Container } from './Header.style';
6
6
  import { NavigationHeader } from './NavigationHeader';
7
7
  import { WalletHeader } from './WalletHeader';
8
- const HeaderContainer = ({ children }) => {
8
+ export const HeaderContainer = ({ children }) => {
9
9
  const { pathname } = useLocation();
10
10
  return (_jsx(Container, Object.assign({ id: ElementId.Header, sticky: stickyHeaderRoutes.some((route) => pathname.includes(route)) }, { children: children })));
11
11
  };
@@ -1,7 +1,7 @@
1
1
  import { AppBar, Box } from '@mui/material';
2
- import { styled } from '@mui/material/styles';
2
+ import { alpha, styled } from '@mui/material/styles';
3
3
  export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
4
- backgroundColor: theme.palette.background.default,
4
+ backgroundColor: 'transparent',
5
5
  color: theme.palette.text.primary,
6
6
  flexDirection: 'row',
7
7
  alignItems: 'center',
@@ -16,7 +16,8 @@ export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
16
16
  export const Container = styled(Box, {
17
17
  shouldForwardProp: (prop) => prop !== 'sticky',
18
18
  })(({ theme, sticky }) => ({
19
- backgroundColor: theme.palette.background.default,
19
+ backgroundColor: alpha(theme.palette.background.default, 0.84),
20
+ backdropFilter: 'blur(12px)',
20
21
  position: sticky ? 'sticky' : 'relative',
21
22
  top: 0,
22
23
  zIndex: 1200,
@@ -14,7 +14,10 @@ export const NavigationHeader = () => {
14
14
  const { account } = useWallet();
15
15
  const { element } = useHeaderActionStore();
16
16
  const { pathname } = useLocation();
17
- const path = pathname.substring(pathname.lastIndexOf('/') + 1);
17
+ const cleanedPathname = pathname.endsWith('/')
18
+ ? pathname.slice(0, -1)
19
+ : pathname;
20
+ const path = cleanedPathname.substring(cleanedPathname.lastIndexOf('/') + 1);
18
21
  const hasPath = navigationRoutesValues.includes(path);
19
22
  const handleHeaderTitle = () => {
20
23
  switch (path) {
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
- import { AccountBalanceWalletOutlined as AccountBalanceWalletIcon, Logout as LogoutIcon, } from '@mui/icons-material';
11
+ import { Logout as LogoutIcon, WalletOutlined as WalletOutlinedIcon, } from '@mui/icons-material';
12
12
  import { Box, IconButton, Typography } from '@mui/material';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { useLocation, useNavigate } from 'react-router-dom';
@@ -39,5 +39,5 @@ const ConnectButton = () => {
39
39
  }
40
40
  navigate(navigationRoutes.selectWallet);
41
41
  });
42
- return (_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "disconnect", edge: "end", onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined }, { children: _jsx(AccountBalanceWalletIcon, {}) })));
42
+ return (_jsx(IconButton, Object.assign({ size: "medium", "aria-label": "disconnect", edge: "end", onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined }, { children: _jsx(WalletOutlinedIcon, {}) })));
43
43
  };
@@ -1,9 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Tooltip, Typography } from '@mui/material';
3
+ import { useLocation } from 'react-router-dom';
3
4
  import { version } from '../../config/version';
5
+ import { navigationRoutes } from '../../utils';
4
6
  import { LiFiLogo } from '../LiFiLogo';
5
7
  import { Link } from './PoweredBy.style';
6
8
  export const PoweredBy = () => {
9
+ const { pathname } = useLocation();
10
+ if (pathname.includes(navigationRoutes.fromToken) ||
11
+ pathname.includes(navigationRoutes.toToken)) {
12
+ return null;
13
+ }
7
14
  return (_jsx(Box, Object.assign({ px: 3, pt: 2, pb: 2, sx: {
8
15
  display: 'flex',
9
16
  alignItems: 'flex-end',