@ape.swap/bonds-sdk 1.0.725 → 1.0.727
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.
|
@@ -43,10 +43,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
43
43
|
}
|
|
44
44
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
45
|
};
|
|
46
|
-
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
46
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
47
47
|
/** @jsxImportSource theme-ui */
|
|
48
48
|
import { useEffect, useState } from 'react';
|
|
49
|
-
import { Flex, ThemeUIProvider } from 'theme-ui';
|
|
49
|
+
import { Flex, Spinner, ThemeUIProvider } from 'theme-ui';
|
|
50
50
|
import getTimePeriods from '../../utils/getTimePeriods';
|
|
51
51
|
import { defaultTheme } from '../../theme';
|
|
52
52
|
import '../../scss/YourBonds.scss';
|
|
@@ -256,7 +256,7 @@ var YourBonds = function (_a) {
|
|
|
256
256
|
setIsModalOpen(false);
|
|
257
257
|
};
|
|
258
258
|
return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isModalOpen &&
|
|
259
|
-
_jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), bondsRendered
|
|
259
|
+
_jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), !bondsRendered ? (_jsxs(_Fragment, { children: [" ", _jsx(Spinner, { size: 20 }), " "] })) : (_jsxs(Flex, { className: "yourbonds table-container", children: [_jsxs(Flex, { className: "yourbonds header-container", children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds 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', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds header-claimable", children: ["CLAIMABLE", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('claimable'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-pending", children: ["PENDING", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('pending'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-terms", children: ["TERMS", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "yourbonds header-claimall" })] })] }), filteredBonds.map(function (bill) {
|
|
260
260
|
var _a, _b;
|
|
261
261
|
return (_jsxs(Flex, { className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") })] }), _jsxs(Flex, { className: "yourbonds column-pending", children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") })] }), _jsx(Flex, { className: "yourbonds column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "yourbonds column-claimall", children: chainId !== bill.bond.chainId ?
|
|
262
262
|
_jsxs(Button, { className: "switch-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
|