@ape.swap/bonds-sdk 1.0.751 → 1.0.752
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.
|
@@ -9,32 +9,32 @@ 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
|
-
import {
|
|
12
|
+
import { useState } from "react";
|
|
13
13
|
import '../../scss/BondRow.scss';
|
|
14
14
|
import { Flex } from "theme-ui";
|
|
15
15
|
var BondRow = function (_a) {
|
|
16
16
|
// const navigate = useNavigate();
|
|
17
17
|
var _b, _c, _d;
|
|
18
18
|
var bond = _a.bond, hotBonds = _a.hotBonds;
|
|
19
|
+
function useForceUpdate() {
|
|
20
|
+
var _a = useState(0), value = _a[0], setValue = _a[1];
|
|
21
|
+
return function () { return setValue(function (value) { return value + 1; }); };
|
|
22
|
+
}
|
|
19
23
|
// Modal
|
|
20
24
|
var _e = useState(false), isModalOpen = _e[0], setIsModalOpen = _e[1];
|
|
21
25
|
var _f = useState(null), selectedBond = _f[0], setSelectedBond = _f[1];
|
|
22
|
-
var _g = useState(window.location.href), url = _g[0], setUrl = _g[1];
|
|
23
26
|
var rowClick = function (bond) {
|
|
24
27
|
setSelectedBond(bond);
|
|
25
28
|
setIsModalOpen(true);
|
|
26
29
|
if (typeof window !== "undefined") {
|
|
27
30
|
var newUrl = "/?bondAddress=".concat(bond.billAddress, "&bondChain=").concat(bond.chainId);
|
|
28
31
|
window.history.pushState({ path: newUrl }, '', newUrl);
|
|
29
|
-
setUrl(newUrl); // Update the state to trigger a re-render
|
|
30
32
|
}
|
|
33
|
+
useForceUpdate();
|
|
31
34
|
console.log('row clicked');
|
|
32
35
|
console.log(bond);
|
|
33
36
|
console.log('isModalOpen:', isModalOpen);
|
|
34
37
|
};
|
|
35
|
-
useEffect(function () {
|
|
36
|
-
console.log('URL changed:', url);
|
|
37
|
-
}, [url]);
|
|
38
38
|
// Functions for calcuations
|
|
39
39
|
var vestingTime = function (vestingTerm) {
|
|
40
40
|
return getTimePeriods(vestingTerm !== null && vestingTerm !== void 0 ? vestingTerm : 0, true);
|