@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.js
CHANGED
|
@@ -1731,21 +1731,6 @@ function useAmountChangeFlash(ref, amount, side) {
|
|
|
1731
1731
|
prevAmountRef.current = amount;
|
|
1732
1732
|
}, [amount, ref, side]);
|
|
1733
1733
|
}
|
|
1734
|
-
function useMidPriceFlash(ref, midPrice, restBgColor) {
|
|
1735
|
-
const prevMidRef = React5__namespace.useRef(midPrice);
|
|
1736
|
-
React5__namespace.useEffect(() => {
|
|
1737
|
-
const prev = prevMidRef.current;
|
|
1738
|
-
const node = ref.current;
|
|
1739
|
-
if (prev !== midPrice && prev > 0 && midPrice > 0 && node && typeof node.animate === "function") {
|
|
1740
|
-
const color = midPrice > prev ? FLASH_UP_COLOR : FLASH_DOWN_COLOR;
|
|
1741
|
-
node.animate(
|
|
1742
|
-
[{ backgroundColor: color }, { backgroundColor: restBgColor }],
|
|
1743
|
-
{ duration: FLASH_DURATION_MS, easing: "ease-out" }
|
|
1744
|
-
);
|
|
1745
|
-
}
|
|
1746
|
-
prevMidRef.current = midPrice;
|
|
1747
|
-
}, [midPrice, ref, restBgColor]);
|
|
1748
|
-
}
|
|
1749
1734
|
function ExternalLinkIcon() {
|
|
1750
1735
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 9L9 1M9 1H4M9 1V6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1751
1736
|
}
|
|
@@ -2089,8 +2074,6 @@ function DesktopOrderbookLayout({
|
|
|
2089
2074
|
compactLevelCount: _compactLevelCount,
|
|
2090
2075
|
fillHeight
|
|
2091
2076
|
}) {
|
|
2092
|
-
const midRef = React5__namespace.useRef(null);
|
|
2093
|
-
useMidPriceFlash(midRef, midPrice, "#0b1a24");
|
|
2094
2077
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2095
2078
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 pt-4", children: [
|
|
2096
2079
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2218,7 +2201,6 @@ function DesktopOrderbookLayout({
|
|
|
2218
2201
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2219
2202
|
"div",
|
|
2220
2203
|
{
|
|
2221
|
-
ref: midRef,
|
|
2222
2204
|
className: "flex items-center gap-2 bg-[#0b1a24] px-3 py-2 flex-shrink-0 overflow-hidden orderbook-mid-row",
|
|
2223
2205
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("text-lg font-semibold tabular-nums whitespace-nowrap orderbook-mid-price", midClass), children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 110, height: 20 }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2224
2206
|
"$",
|
|
@@ -2287,8 +2269,6 @@ function MobileOrderbookLayout({
|
|
|
2287
2269
|
levelCount: _levelCount,
|
|
2288
2270
|
compactLevelCount: effectiveCompactLevels
|
|
2289
2271
|
}) {
|
|
2290
|
-
const midRef = React5__namespace.useRef(null);
|
|
2291
|
-
useMidPriceFlash(midRef, midPrice, "transparent");
|
|
2292
2272
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2293
2273
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2294
2274
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -2374,7 +2354,6 @@ function MobileOrderbookLayout({
|
|
|
2374
2354
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2375
2355
|
"div",
|
|
2376
2356
|
{
|
|
2377
|
-
ref: midRef,
|
|
2378
2357
|
className: "grid",
|
|
2379
2358
|
style: {
|
|
2380
2359
|
gridTemplateColumns: "1.2fr 0.8fr",
|