@gearbox-protocol/permissionless-ui 1.26.7 → 1.26.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react"),y=require("../rounded-image/rounded-image.cjs"),g=require("../skeleton/skeleton.cjs");require("@gearbox-protocol/sdk");require("clsx");require("tailwind-merge");require("sonner");const c=require("../../utils/format-money.cjs"),u=require("../../utils/static.cjs");require("luxon");require("../../utils/z-index.cjs");function d({reward:r,tokensList:s,...n}){const t=s?.[r?.rewardToken||""]?.symbol||r?.rewardTokenSymbol,{size:e=t==="GEAR"?11:12,margin:a=t==="GEAR"?"-5px 2px 0 2px":"-3px 2px 0 2px"}=n;return o.jsx(y.RoundedImage,{src:t==="GEAR"?u.getStatic("/logo/logo_symbol.png"):u.getStatic(`/tokens/${t?.toLowerCase()}.svg`),size:e,rounded:!1,style:{margin:a,height:"auto"}})}const p=i.forwardRef(({poolAPY:r,extraAPY:s,tokensList:n},t)=>o.jsx("div",{ref:t,className:"inline-block",children:s.length>0&&o.jsx("span",{className:"text-xs",children:o.jsxs("span",{className:"flex items-start text-secondary-foreground font-normal",children:[c.percentTemplate(r)," +",o.jsx("span",{className:"flex flex-col items-end flex-wrap",children:s.map(e=>{const a=e.apy||0;return a>0&&o.jsxs("span",{children:[o.jsx(d,{reward:e,tokensList:n}),c.percentTemplate(a)]},`${e.token}-${e.rewardToken}-${e.apy}-${e.endTimestamp}`)})})]})})}));p.displayName="ApyParts";function f({totalAPY:r,totalAPYLoading:s,baseAPY:n,extraAPY:t,tokensList:e}){const a=i.useMemo(()=>n.reduce((l,x)=>l+x.apy,0),[n]),m=i.useMemo(()=>t.filter(l=>(l.apy||0)>0),[t]);return o.jsx(g.Skeleton,{width:80,loading:s,children:r>=.001&&o.jsx(p,{extraAPY:m,poolAPY:a,tokensList:e})})}exports.DetailedApy=f;exports.PoolRewardsIcon=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { forwardRef as y, useMemo as
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useMemo as l } from "react";
|
|
3
3
|
import { RoundedImage as u } from "../rounded-image/rounded-image.js";
|
|
4
4
|
import { Skeleton as g } from "../skeleton/skeleton.js";
|
|
5
5
|
import "@gearbox-protocol/sdk";
|
|
@@ -15,53 +15,59 @@ function h({
|
|
|
15
15
|
tokensList: n,
|
|
16
16
|
...a
|
|
17
17
|
}) {
|
|
18
|
-
const
|
|
19
|
-
size:
|
|
20
|
-
margin: s =
|
|
18
|
+
const o = n?.[t?.rewardToken || ""]?.symbol || t?.rewardTokenSymbol, {
|
|
19
|
+
size: e = o === "GEAR" ? 11 : 12,
|
|
20
|
+
margin: s = o === "GEAR" ? "-5px 2px 0 2px" : "-3px 2px 0 2px"
|
|
21
21
|
} = a;
|
|
22
22
|
return /* @__PURE__ */ r(
|
|
23
23
|
u,
|
|
24
24
|
{
|
|
25
|
-
src:
|
|
26
|
-
size:
|
|
25
|
+
src: o === "GEAR" ? c("/logo/logo_symbol.png") : c(`/tokens/${o?.toLowerCase()}.svg`),
|
|
26
|
+
size: e,
|
|
27
27
|
rounded: !1,
|
|
28
28
|
style: { margin: s, height: "auto" }
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
const d = y(({ poolAPY: t, extraAPY: n, tokensList: a },
|
|
32
|
+
const d = y(({ poolAPY: t, extraAPY: n, tokensList: a }, o) => /* @__PURE__ */ r("div", { ref: o, className: "inline-block", children: n.length > 0 && /* @__PURE__ */ r("span", { className: "text-xs", children: /* @__PURE__ */ m("span", { className: "flex items-start text-secondary-foreground font-normal", children: [
|
|
33
33
|
i(t),
|
|
34
34
|
" +",
|
|
35
|
-
/* @__PURE__ */ r("span", { className: "flex flex-col items-end flex-wrap", children: n.map((
|
|
36
|
-
const s =
|
|
37
|
-
return s > 0 && /* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
/* @__PURE__ */ r("span", { className: "flex flex-col items-end flex-wrap", children: n.map((e) => {
|
|
36
|
+
const s = e.apy || 0;
|
|
37
|
+
return s > 0 && /* @__PURE__ */ m(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ r(h, { reward: e, tokensList: a }),
|
|
42
|
+
i(s)
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
`${e.token}-${e.rewardToken}-${e.apy}-${e.endTimestamp}`
|
|
46
|
+
);
|
|
41
47
|
}) })
|
|
42
48
|
] }) }) }));
|
|
43
49
|
d.displayName = "ApyParts";
|
|
44
|
-
function
|
|
50
|
+
function j({
|
|
45
51
|
totalAPY: t,
|
|
46
52
|
totalAPYLoading: n,
|
|
47
53
|
baseAPY: a,
|
|
48
|
-
extraAPY:
|
|
49
|
-
tokensList:
|
|
54
|
+
extraAPY: o,
|
|
55
|
+
tokensList: e
|
|
50
56
|
}) {
|
|
51
|
-
const s =
|
|
57
|
+
const s = l(
|
|
52
58
|
() => a.reduce((p, x) => p + x.apy, 0),
|
|
53
59
|
[a]
|
|
54
|
-
), f =
|
|
60
|
+
), f = l(() => o.filter((p) => (p.apy || 0) > 0), [o]);
|
|
55
61
|
return /* @__PURE__ */ r(g, { width: 80, loading: n, children: t >= 1e-3 && /* @__PURE__ */ r(
|
|
56
62
|
d,
|
|
57
63
|
{
|
|
58
64
|
extraAPY: f,
|
|
59
65
|
poolAPY: s,
|
|
60
|
-
tokensList:
|
|
66
|
+
tokensList: e
|
|
61
67
|
}
|
|
62
68
|
) });
|
|
63
69
|
}
|
|
64
70
|
export {
|
|
65
|
-
|
|
71
|
+
j as DetailedApy,
|
|
66
72
|
h as PoolRewardsIcon
|
|
67
73
|
};
|