@ape.swap/bonds-sdk 1.0.103 → 1.0.105
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.
|
@@ -53,7 +53,7 @@ import axios from 'axios';
|
|
|
53
53
|
import { ethers } from 'ethers';
|
|
54
54
|
import { useWeb3React } from '@web3-react/core';
|
|
55
55
|
import { useSearchParams, useNavigate } from 'react-router-dom';
|
|
56
|
-
import styles
|
|
56
|
+
import styles from './styles';
|
|
57
57
|
import getTimePeriods from '../../utils/getTimePeriods';
|
|
58
58
|
import { defaultTheme } from '../../theme';
|
|
59
59
|
import Svg from '../uikit/Svg';
|
|
@@ -137,25 +137,17 @@ var Bonds = function (_a) {
|
|
|
137
137
|
});
|
|
138
138
|
var _f = useState(false), isModalOpen = _f[0], setIsModalOpen = _f[1];
|
|
139
139
|
var _g = useState(null), selectedBond = _g[0], setSelectedBond = _g[1];
|
|
140
|
-
// const rowClick = (bond: BondsDataResponse) => {
|
|
141
|
-
// const url = `${window.location.origin}?bondAddress=${bond.billAddress}&bondChain=${bond.chainId}`;
|
|
142
|
-
// window.location.href = url;
|
|
143
|
-
// // setSelectedBond(bond);
|
|
144
|
-
// // setIsModalOpen(true);
|
|
145
|
-
// };
|
|
146
140
|
var rowClick = function (bond) {
|
|
147
141
|
setSelectedBond(bond);
|
|
148
142
|
setIsModalOpen(true);
|
|
149
143
|
navigate("/?bondAddress=".concat(bond.billAddress, "&bondChain=").concat(bond.chainId), { replace: true });
|
|
150
144
|
};
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
setSelectedBond(null);
|
|
154
|
-
navigate('/', { replace: true });
|
|
145
|
+
var getDiscountColorStyle = function (discount) {
|
|
146
|
+
return discount < 0 ? 'discount-negative' : 'discount-positive';
|
|
155
147
|
};
|
|
156
148
|
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Discount" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "ARR" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens Remaining" })), _jsx(Flex, { className: "column column-header" })] })), sortedBonds.map(function (bond) {
|
|
157
|
-
var _a, _b, _c
|
|
158
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount"
|
|
149
|
+
var _a, _b, _c;
|
|
150
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColorStyle(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: bond.tokensRemaining.split('.')[0] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
|
|
159
151
|
})] }))] })));
|
|
160
152
|
};
|
|
161
153
|
export default Bonds;
|
package/dist/scss/bonds.scss
CHANGED