@loafmarkets/ui 0.1.341 → 0.1.342
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.
- package/dist/index.js +0 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1705,21 +1705,6 @@ function useAmountChangeFlash(ref, amount, side) {
|
|
|
1705
1705
|
prevAmountRef.current = amount;
|
|
1706
1706
|
}, [amount, ref, side]);
|
|
1707
1707
|
}
|
|
1708
|
-
function useMidPriceFlash(ref, midPrice, restBgColor) {
|
|
1709
|
-
const prevMidRef = React5.useRef(midPrice);
|
|
1710
|
-
React5.useEffect(() => {
|
|
1711
|
-
const prev = prevMidRef.current;
|
|
1712
|
-
const node = ref.current;
|
|
1713
|
-
if (prev !== midPrice && prev > 0 && midPrice > 0 && node && typeof node.animate === "function") {
|
|
1714
|
-
const color = midPrice > prev ? FLASH_UP_COLOR : FLASH_DOWN_COLOR;
|
|
1715
|
-
node.animate(
|
|
1716
|
-
[{ backgroundColor: color }, { backgroundColor: restBgColor }],
|
|
1717
|
-
{ duration: FLASH_DURATION_MS, easing: "ease-out" }
|
|
1718
|
-
);
|
|
1719
|
-
}
|
|
1720
|
-
prevMidRef.current = midPrice;
|
|
1721
|
-
}, [midPrice, ref, restBgColor]);
|
|
1722
|
-
}
|
|
1723
1708
|
function ExternalLinkIcon() {
|
|
1724
1709
|
return /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M1 9L9 1M9 1H4M9 1V6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1725
1710
|
}
|
|
@@ -2063,8 +2048,6 @@ function DesktopOrderbookLayout({
|
|
|
2063
2048
|
compactLevelCount: _compactLevelCount,
|
|
2064
2049
|
fillHeight
|
|
2065
2050
|
}) {
|
|
2066
|
-
const midRef = React5.useRef(null);
|
|
2067
|
-
useMidPriceFlash(midRef, midPrice, "#0b1a24");
|
|
2068
2051
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2069
2052
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 pt-4", children: [
|
|
2070
2053
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2192,7 +2175,6 @@ function DesktopOrderbookLayout({
|
|
|
2192
2175
|
/* @__PURE__ */ jsx(
|
|
2193
2176
|
"div",
|
|
2194
2177
|
{
|
|
2195
|
-
ref: midRef,
|
|
2196
2178
|
className: "flex items-center gap-2 bg-[#0b1a24] px-3 py-2 flex-shrink-0 overflow-hidden orderbook-mid-row",
|
|
2197
2179
|
children: /* @__PURE__ */ jsx("div", { className: cn("text-lg font-semibold tabular-nums whitespace-nowrap orderbook-mid-price", midClass), children: isLoading ? /* @__PURE__ */ jsx(Skeleton, { width: 110, height: 20 }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2198
2180
|
"$",
|
|
@@ -2261,8 +2243,6 @@ function MobileOrderbookLayout({
|
|
|
2261
2243
|
levelCount: _levelCount,
|
|
2262
2244
|
compactLevelCount: effectiveCompactLevels
|
|
2263
2245
|
}) {
|
|
2264
|
-
const midRef = React5.useRef(null);
|
|
2265
|
-
useMidPriceFlash(midRef, midPrice, "transparent");
|
|
2266
2246
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2267
2247
|
/* @__PURE__ */ jsx("div", { className: "px-3 pt-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2268
2248
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -2348,7 +2328,6 @@ function MobileOrderbookLayout({
|
|
|
2348
2328
|
/* @__PURE__ */ jsxs(
|
|
2349
2329
|
"div",
|
|
2350
2330
|
{
|
|
2351
|
-
ref: midRef,
|
|
2352
2331
|
className: "grid",
|
|
2353
2332
|
style: {
|
|
2354
2333
|
gridTemplateColumns: "1.2fr 0.8fr",
|