@ape.swap/bonds-sdk 1.0.431 → 1.0.433
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.
|
@@ -10,38 +10,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
13
|
-
import { useEffect, useRef, useState } from 'react';
|
|
14
13
|
import { Flex } from '../../../components/uikit-sdk';
|
|
15
14
|
import { ChainId, MAINNET_CHAINS } from '../../../config/constants/chains';
|
|
16
15
|
import BondRowsWithTitle from './BondRowsWithTitle';
|
|
17
16
|
var BondRowsByChain = function (_a) {
|
|
18
17
|
var bonds = _a.bonds, hotBonds = _a.hotBonds, rowClick = _a.rowClick;
|
|
19
|
-
//used to render list only on client
|
|
20
|
-
var _b = useState(false), show = _b[0], setShow = _b[1];
|
|
21
|
-
var observerRef = useRef(null);
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
var observer;
|
|
24
|
-
observer = new IntersectionObserver(function (_a) {
|
|
25
|
-
var entry = _a[0];
|
|
26
|
-
if (entry.isIntersecting) {
|
|
27
|
-
setShow(true);
|
|
28
|
-
if (observer) {
|
|
29
|
-
observer.disconnect();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
rootMargin: '0px',
|
|
34
|
-
threshold: 1,
|
|
35
|
-
});
|
|
36
|
-
if (observerRef.current) {
|
|
37
|
-
observer.observe(observerRef.current);
|
|
38
|
-
}
|
|
39
|
-
return function () {
|
|
40
|
-
if (observer) {
|
|
41
|
-
observer.disconnect();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
18
|
return (_jsxs(Flex, __assign({ sx: { width: '100%', flexDirection: 'column', mt: '5px' } }, { children: [[ChainId.MAINNET].map(function (chain, index) {
|
|
46
19
|
return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, rowClick: rowClick }, chain));
|
|
47
20
|
}), [ChainId.BSC].map(function (chain, index) {
|
|
@@ -269,39 +269,6 @@ var Bonds = function (_a) {
|
|
|
269
269
|
setBondsRendered(true);
|
|
270
270
|
}
|
|
271
271
|
}, [filteredBonds]);
|
|
272
|
-
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px' }, width: '100%', placeholder: 'Search...' }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)" }, { children: ["Discount", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('discount'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-arr" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)" }, { children: ["ARR", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('arr'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-terms" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)" }, { children: ["Terms", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)" }, { children: ["Tokens Remaining", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('tokensRemaining'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsx(Flex, { className: "column column-hotbond" })] }))] })),
|
|
273
|
-
// <Flex sx={{ width: '100%', flexDirection: 'column', mt: '5px' }}>
|
|
274
|
-
// {[ChainId.MAINNET].map((chain, index) => {
|
|
275
|
-
// return (
|
|
276
|
-
// <BondRow
|
|
277
|
-
// key={bond.billAddress}
|
|
278
|
-
// bond={bond}
|
|
279
|
-
// hotBonds={hotBonds}
|
|
280
|
-
// rowClick={rowClick}
|
|
281
|
-
// />
|
|
282
|
-
// )
|
|
283
|
-
// })}
|
|
284
|
-
// {[ChainId.BSC].map((chain, index) => {
|
|
285
|
-
// return (
|
|
286
|
-
// <BondRow
|
|
287
|
-
// key={bond.billAddress}
|
|
288
|
-
// bond={bond}
|
|
289
|
-
// hotBonds={hotBonds}
|
|
290
|
-
// rowClick={rowClick}
|
|
291
|
-
// />
|
|
292
|
-
// )
|
|
293
|
-
// })}
|
|
294
|
-
// {(MAINNET_CHAINS.slice(2, MAINNET_CHAINS.length).map((chain, index) => {
|
|
295
|
-
// return (
|
|
296
|
-
// <BondRow
|
|
297
|
-
// key={bond.billAddress}
|
|
298
|
-
// bond={bond}
|
|
299
|
-
// hotBonds={hotBonds}
|
|
300
|
-
// rowClick={rowClick}
|
|
301
|
-
// />
|
|
302
|
-
// )
|
|
303
|
-
// }))}
|
|
304
|
-
// </Flex>
|
|
305
|
-
); })] })))] })));
|
|
272
|
+
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px' }, width: '100%', placeholder: 'Search...' }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)" }, { children: ["Discount", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('discount'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-arr" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)" }, { children: ["ARR", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('arr'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-terms" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)" }, { children: ["Terms", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)" }, { children: ["Tokens Remaining", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('tokensRemaining'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsx(Flex, { className: "column column-hotbond" })] }))] })), _jsx(BondRowsByChain, { bonds: filteredBonds, hotBonds: hotBonds, rowClick: rowClick })] })))] })));
|
|
306
273
|
};
|
|
307
274
|
export default Bonds;
|