@lifi/widget 1.23.0 → 1.23.1

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.
@@ -23,6 +23,6 @@ const SelectChainAndToken = (props) => {
23
23
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.FromToken)) ||
24
24
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.ToToken));
25
25
  const isCompact = fromChain && toChain && fromToken && toToken && !prefersNarrowView;
26
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, m: !disabledReverse ? -1.25 : 1 }, { children: !disabledReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })), (0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })] })));
26
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, m: !disabledReverse ? -1.125 : 1 }, { children: !disabledReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })), (0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })] })));
27
27
  };
28
28
  exports.SelectChainAndToken = SelectChainAndToken;
@@ -47,7 +47,7 @@ exports.SwapButton = (0, react_1.forwardRef)(({ onClick, currentRoute, text, dis
47
47
  }
48
48
  return variant !== 'refuel'
49
49
  ? t(`button.reviewSwap`)
50
- : t(`button.startSwap`);
50
+ : t(`button.startGasSwap`);
51
51
  }
52
52
  return t(`button.connectWallet`);
53
53
  };
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.23.0";
2
+ export declare const version = "1.23.1";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '1.23.0';
5
+ exports.version = '1.23.1';
@@ -6,10 +6,14 @@ const sdk_1 = require("@lifi/sdk");
6
6
  const react_1 = require("react");
7
7
  const version_1 = require("../config/version");
8
8
  const useTools_1 = require("./useTools");
9
+ let checkedPackageUpdates = false;
9
10
  const useInitializer = () => {
10
11
  (0, useTools_1.useTools)();
11
12
  (0, react_1.useEffect)(() => {
12
- (0, sdk_1.checkPackageUpdates)(version_1.name, version_1.version);
13
+ if (!checkedPackageUpdates) {
14
+ checkedPackageUpdates = true;
15
+ (0, sdk_1.checkPackageUpdates)(version_1.name, version_1.version);
16
+ }
13
17
  }, []);
14
18
  };
15
19
  exports.useInitializer = useInitializer;
@@ -8,7 +8,7 @@ const stores_1 = require("../stores");
8
8
  const useTools = () => {
9
9
  const lifi = (0, providers_1.useLiFi)();
10
10
  const { bridges, exchanges } = (0, providers_1.useWidgetConfig)();
11
- const { data } = (0, react_query_1.useQuery)(['tools'], ({ signal }) => lifi.getTools(undefined, { signal }), {
11
+ const { data } = (0, react_query_1.useQuery)(['tools'], () => lifi.getTools(), {
12
12
  onSuccess(data) {
13
13
  const { initializeTools } = stores_1.useSettingsStore.getState();
14
14
  initializeTools('Bridges', data.bridges
@@ -20,5 +20,5 @@ export const SelectChainAndToken = (props) => {
20
20
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.FromToken)) ||
21
21
  (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToToken));
22
22
  const isCompact = fromChain && toChain && fromToken && toToken && !prefersNarrowView;
23
- return (_jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), _jsx(Box, Object.assign({ sx: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, m: !disabledReverse ? -1.25 : 1 }, { children: !disabledReverse ? (_jsx(ReverseTokensButton, { vertical: !isCompact })) : null })), _jsx(SelectTokenButton, { formType: "to", compact: isCompact })] })));
23
+ return (_jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' } }, props, { children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), _jsx(Box, Object.assign({ sx: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, m: !disabledReverse ? -1.125 : 1 }, { children: !disabledReverse ? (_jsx(ReverseTokensButton, { vertical: !isCompact })) : null })), _jsx(SelectTokenButton, { formType: "to", compact: isCompact })] })));
24
24
  };
@@ -44,7 +44,7 @@ export const SwapButton = forwardRef(({ onClick, currentRoute, text, disable, en
44
44
  }
45
45
  return variant !== 'refuel'
46
46
  ? t(`button.reviewSwap`)
47
- : t(`button.startSwap`);
47
+ : t(`button.startGasSwap`);
48
48
  }
49
49
  return t(`button.connectWallet`);
50
50
  };
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.23.0";
2
+ export declare const version = "1.23.1";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '1.23.0';
2
+ export const version = '1.23.1';
@@ -3,9 +3,13 @@ import { checkPackageUpdates } from '@lifi/sdk';
3
3
  import { useEffect } from 'react';
4
4
  import { name, version } from '../config/version';
5
5
  import { useTools } from './useTools';
6
+ let checkedPackageUpdates = false;
6
7
  export const useInitializer = () => {
7
8
  useTools();
8
9
  useEffect(() => {
9
- checkPackageUpdates(name, version);
10
+ if (!checkedPackageUpdates) {
11
+ checkedPackageUpdates = true;
12
+ checkPackageUpdates(name, version);
13
+ }
10
14
  }, []);
11
15
  };
package/hooks/useTools.js CHANGED
@@ -5,7 +5,7 @@ import { useSettingsStore } from '../stores';
5
5
  export const useTools = () => {
6
6
  const lifi = useLiFi();
7
7
  const { bridges, exchanges } = useWidgetConfig();
8
- const { data } = useQuery(['tools'], ({ signal }) => lifi.getTools(undefined, { signal }), {
8
+ const { data } = useQuery(['tools'], () => lifi.getTools(), {
9
9
  onSuccess(data) {
10
10
  const { initializeTools } = useSettingsStore.getState();
11
11
  initializeTools('Bridges', data.bridges
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "1.23.0",
3
+ "version": "1.23.1",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -43,7 +43,7 @@
43
43
  "@ethersproject/experimental": "^5.7.0",
44
44
  "@ethersproject/providers": "^5.7.2",
45
45
  "@lifi/sdk": "^1.6.3",
46
- "@lifi/wallet-management": "^1.1.12",
46
+ "@lifi/wallet-management": "^1.1.13",
47
47
  "@mui/icons-material": "^5.10.9",
48
48
  "@mui/lab": "^5.0.0-alpha.107",
49
49
  "@mui/material": "^5.10.13",