@lifi/widget 1.18.2 → 1.18.3
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.
- package/AppRoutes.js +7 -3
- package/cjs/AppRoutes.js +7 -3
- package/cjs/components/BottomSheet/BottomSheet.js +2 -0
- package/cjs/components/ChainSelect/ChainSelect.js +1 -1
- package/cjs/components/Header/WalletHeader.js +1 -3
- package/cjs/components/SendToWallet/SendToWallet.js +1 -1
- package/cjs/components/SendToWallet/SendToWalletButton.js +9 -1
- package/cjs/components/SwapInput/FormPriceHelperText.js +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.js +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +1 -1
- package/cjs/hooks/index.js +1 -1
- package/cjs/hooks/useGasSufficiency.js +10 -11
- package/cjs/hooks/useScrollableContainer.d.ts +0 -1
- package/cjs/hooks/useScrollableContainer.js +1 -15
- package/cjs/hooks/useTokenAddressBalance.d.ts +5 -0
- package/cjs/hooks/useTokenAddressBalance.js +19 -0
- package/cjs/hooks/useTokenBalance.d.ts +7 -3
- package/cjs/hooks/useTokenBalance.js +87 -9
- package/cjs/hooks/useTokenBalances.d.ts +1 -1
- package/cjs/hooks/useTokenBalances.js +1 -4
- package/cjs/i18n/en/translation.json +1 -1
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +1 -11
- package/cjs/pages/SwapPage/StatusBottomSheet.js +19 -6
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/wallet.d.ts +1 -0
- package/cjs/utils/wallet.js +7 -0
- package/components/BottomSheet/BottomSheet.js +2 -0
- package/components/ChainSelect/ChainSelect.js +2 -2
- package/components/Header/WalletHeader.js +2 -4
- package/components/SendToWallet/SendToWallet.js +1 -1
- package/components/SendToWallet/SendToWalletButton.js +10 -2
- package/components/SwapInput/FormPriceHelperText.js +2 -2
- package/components/SwapInput/SwapInputAdornment.js +2 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useGasSufficiency.js +11 -12
- package/hooks/useScrollableContainer.d.ts +0 -1
- package/hooks/useScrollableContainer.js +0 -13
- package/hooks/useTokenAddressBalance.d.ts +5 -0
- package/hooks/useTokenAddressBalance.js +15 -0
- package/hooks/useTokenBalance.d.ts +7 -3
- package/hooks/useTokenBalance.js +88 -10
- package/hooks/useTokenBalances.d.ts +1 -1
- package/hooks/useTokenBalances.js +1 -4
- package/i18n/en/translation.json +1 -1
- package/package.json +5 -5
- package/pages/SelectTokenPage/SelectTokenPage.js +2 -12
- package/pages/SwapPage/StatusBottomSheet.js +19 -6
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/wallet.d.ts +1 -0
- package/utils/wallet.js +3 -0
- package/cjs/components/SwapButton/ButtonTooltip.d.ts +0 -5
- package/cjs/components/SwapButton/ButtonTooltip.js +0 -7
- package/cjs/hooks/useContentHeight.d.ts +0 -1
- package/cjs/hooks/useContentHeight.js +0 -27
- package/components/SwapButton/ButtonTooltip.d.ts +0 -5
- package/components/SwapButton/ButtonTooltip.js +0 -3
- package/hooks/useContentHeight.d.ts +0 -1
- package/hooks/useContentHeight.js +0 -23
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shortenWalletAddress: (address?: string) => string | null;
|
package/utils/wallet.js
ADDED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ButtonTooltip = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const ButtonTooltip = ({ title, children, }) => title ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: title, placement: "top", enterDelay: 250, arrow: true }, { children: (0, jsx_runtime_1.jsx)("span", { children: children }) }))) : (children);
|
|
7
|
-
exports.ButtonTooltip = ButtonTooltip;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useContentHeight: () => number;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useContentHeight = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
const getContentHeight = () => {
|
|
7
|
-
const headerElement = document.getElementById(utils_1.ElementId.Header);
|
|
8
|
-
const containerElement = document.getElementById(utils_1.ElementId.ScrollableContainer);
|
|
9
|
-
if (!containerElement || !headerElement) {
|
|
10
|
-
console.warn(`Can't find ${utils_1.ElementId.ScrollableContainer} or ${utils_1.ElementId.Header} id.`);
|
|
11
|
-
return 0;
|
|
12
|
-
}
|
|
13
|
-
const { height: containerHeight } = containerElement.getBoundingClientRect();
|
|
14
|
-
const { height: headerHeight } = headerElement.getBoundingClientRect();
|
|
15
|
-
return containerHeight - headerHeight;
|
|
16
|
-
};
|
|
17
|
-
const useContentHeight = () => {
|
|
18
|
-
const [contentHeight, setContentHeight] = (0, react_1.useState)(getContentHeight);
|
|
19
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
20
|
-
if (!contentHeight) {
|
|
21
|
-
setContentHeight(getContentHeight());
|
|
22
|
-
}
|
|
23
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
}, []);
|
|
25
|
-
return contentHeight;
|
|
26
|
-
};
|
|
27
|
-
exports.useContentHeight = useContentHeight;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Tooltip } from '@mui/material';
|
|
3
|
-
export const ButtonTooltip = ({ title, children, }) => title ? (_jsx(Tooltip, Object.assign({ title: title, placement: "top", enterDelay: 250, arrow: true }, { children: _jsx("span", { children: children }) }))) : (children);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useContentHeight: () => number;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect, useState } from 'react';
|
|
2
|
-
import { ElementId } from '../utils';
|
|
3
|
-
const getContentHeight = () => {
|
|
4
|
-
const headerElement = document.getElementById(ElementId.Header);
|
|
5
|
-
const containerElement = document.getElementById(ElementId.ScrollableContainer);
|
|
6
|
-
if (!containerElement || !headerElement) {
|
|
7
|
-
console.warn(`Can't find ${ElementId.ScrollableContainer} or ${ElementId.Header} id.`);
|
|
8
|
-
return 0;
|
|
9
|
-
}
|
|
10
|
-
const { height: containerHeight } = containerElement.getBoundingClientRect();
|
|
11
|
-
const { height: headerHeight } = headerElement.getBoundingClientRect();
|
|
12
|
-
return containerHeight - headerHeight;
|
|
13
|
-
};
|
|
14
|
-
export const useContentHeight = () => {
|
|
15
|
-
const [contentHeight, setContentHeight] = useState(getContentHeight);
|
|
16
|
-
useLayoutEffect(() => {
|
|
17
|
-
if (!contentHeight) {
|
|
18
|
-
setContentHeight(getContentHeight());
|
|
19
|
-
}
|
|
20
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
-
}, []);
|
|
22
|
-
return contentHeight;
|
|
23
|
-
};
|