@ape.swap/bonds-sdk 1.0.691 → 1.0.692
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.
|
@@ -5,12 +5,13 @@ import ProgressBar from "../ProgressBar/ProgressBar";
|
|
|
5
5
|
import ProgressBarWrapper from "../ProgressBar/ProgressBarWrapper";
|
|
6
6
|
import TokenInfoAndName from "../TokenInfoAndName";
|
|
7
7
|
import Tooltip from "../Tooltip/Tooltip";
|
|
8
|
-
import {
|
|
8
|
+
import { Svg, TooltipBubble } from "../uikit-sdk";
|
|
9
9
|
import { formatDollar, formatValue } from "../../utils/formatNumbers";
|
|
10
10
|
import getTimePeriods from "../../utils/getTimePeriods";
|
|
11
11
|
import { BLOCK_EXPLORER } from "../../config/constants/chains";
|
|
12
12
|
import { useState } from "react";
|
|
13
13
|
import '../../scss/BondRow.scss';
|
|
14
|
+
import { Flex } from "theme-ui";
|
|
14
15
|
var BondRow = function (_a) {
|
|
15
16
|
// const navigate = useNavigate();
|
|
16
17
|
var _b, _c, _d;
|
|
@@ -255,9 +255,9 @@ var YourBonds = function (_a) {
|
|
|
255
255
|
setIsModalOpen(false);
|
|
256
256
|
};
|
|
257
257
|
return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isModalOpen &&
|
|
258
|
-
_jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), bondsRendered && (_jsxs(Flex, { className: "yourbonds table-container", children: [_jsxs(Flex, { className: "yourbonds header-container", children: [_jsx(Flex, { className: "
|
|
258
|
+
_jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), bondsRendered && (_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: [_jsx(Text, { sx: { fontSize: '11px', color: 'textDisabledButton' }, children: "CLAIMABLE" }), _jsx(Flex, { className: "column header-icon", onClick: function () { return handleSort('claimable'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-pending", children: [_jsx(Text, { sx: { fontSize: '11px', color: 'textDisabledButton' }, children: "PENDING" }), _jsx(Flex, { className: "column header-icon", onClick: function () { return handleSort('pending'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-terms", children: [_jsx(Text, { sx: { fontSize: '11px', color: 'textDisabledButton' }, children: "TERMS" }), _jsx(Flex, { className: "column 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) {
|
|
259
259
|
var _a, _b;
|
|
260
|
-
return (_jsxs(Flex, { className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "
|
|
260
|
+
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: _jsx(Button, { className: "claim-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
|
|
261
261
|
event.stopPropagation();
|
|
262
262
|
// Add your claim logic here
|
|
263
263
|
handleClaim(bill.id, bill.address);
|
package/dist/scss/YourBonds.scss
CHANGED
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.
|
|
41
|
+
.yourbonds.column-tokens {
|
|
42
42
|
display: flex;
|
|
43
43
|
align-items: center;
|
|
44
44
|
justify-content: start;
|
|
45
45
|
width: 40%;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.
|
|
48
|
+
.yourbonds.column-search {
|
|
49
49
|
padding-bottom: 0px;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.
|
|
52
|
+
.yourbonds.column-tokeninfoname {
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
55
|
flex-direction: row;
|
|
@@ -57,35 +57,35 @@
|
|
|
57
57
|
align-items: center;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
60
|
+
.yourbonds.column-bondinfo {
|
|
61
61
|
flex-direction: row;
|
|
62
62
|
align-items: center;
|
|
63
63
|
justify-content: end;
|
|
64
64
|
width: 60%;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.
|
|
67
|
+
.yourbonds.header-claimable {
|
|
68
68
|
flex-direction: row;
|
|
69
69
|
justify-content: center;
|
|
70
70
|
align-items: center;
|
|
71
71
|
width: 25%;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.
|
|
74
|
+
.yourbonds.header-pending {
|
|
75
75
|
flex-direction: row;
|
|
76
76
|
justify-content: center;
|
|
77
77
|
align-items: center;
|
|
78
78
|
width: 25%;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.
|
|
81
|
+
.yourbonds.header-terms {
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: center;
|
|
84
84
|
align-items: center;
|
|
85
85
|
width: 25%;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.
|
|
88
|
+
.yourbonds.header-claimall {
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
justify-content: center;
|
|
91
91
|
align-items: center;
|
|
@@ -94,28 +94,28 @@
|
|
|
94
94
|
padding-bottom: 15px;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
.
|
|
97
|
+
.yourbonds.column-claimable {
|
|
98
98
|
flex-direction: row;
|
|
99
99
|
justify-content: center;
|
|
100
100
|
align-items: center;
|
|
101
101
|
width: 25%;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.
|
|
104
|
+
.yourbonds.column-pending {
|
|
105
105
|
flex-direction: row;
|
|
106
106
|
justify-content: center;
|
|
107
107
|
align-items: center;
|
|
108
108
|
width: 25%;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.
|
|
111
|
+
.yourbonds.column-terms {
|
|
112
112
|
flex-direction: row;
|
|
113
113
|
justify-content: center;
|
|
114
114
|
align-items: center;
|
|
115
115
|
width: 25%;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.
|
|
118
|
+
.yourbonds.column-claimall {
|
|
119
119
|
flex-direction: column;
|
|
120
120
|
justify-content: center;
|
|
121
121
|
align-items: center;
|