@loafmarkets/ui 0.1.348 → 0.1.349
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 +27 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -13781,7 +13781,9 @@ function PortfolioActivityPanel({
|
|
|
13781
13781
|
}
|
|
13782
13782
|
};
|
|
13783
13783
|
const mergedOrderHistory = useMemo(() => {
|
|
13784
|
-
if (showSubscriptionsTab || offeringOrders.length === 0)
|
|
13784
|
+
if (showSubscriptionsTab || offeringOrders.length === 0) {
|
|
13785
|
+
return [...orderHistory].sort((a, b) => b.createdAt - a.createdAt);
|
|
13786
|
+
}
|
|
13785
13787
|
const mapped = offeringOrders.map((o, i) => ({
|
|
13786
13788
|
id: o.ipoOrderId ?? -(i + 1),
|
|
13787
13789
|
propertyId: 0,
|
|
@@ -13802,6 +13804,22 @@ function PortfolioActivityPanel({
|
|
|
13802
13804
|
}));
|
|
13803
13805
|
return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
|
|
13804
13806
|
}, [showSubscriptionsTab, offeringOrders, orderHistory]);
|
|
13807
|
+
const sortedOpenOrders = useMemo(
|
|
13808
|
+
() => [...openOrders].sort((a, b) => b.createdAt - a.createdAt),
|
|
13809
|
+
[openOrders]
|
|
13810
|
+
);
|
|
13811
|
+
const sortedOfferingOrders = useMemo(
|
|
13812
|
+
() => [...offeringOrders].sort((a, b) => b.createdAt - a.createdAt),
|
|
13813
|
+
[offeringOrders]
|
|
13814
|
+
);
|
|
13815
|
+
const sortedTradeHistory = useMemo(
|
|
13816
|
+
() => [...tradeHistory].sort((a, b) => b.executedAt - a.executedAt),
|
|
13817
|
+
[tradeHistory]
|
|
13818
|
+
);
|
|
13819
|
+
const sortedTransfers = useMemo(
|
|
13820
|
+
() => [...transfers].sort((a, b) => b.createdAt - a.createdAt),
|
|
13821
|
+
[transfers]
|
|
13822
|
+
);
|
|
13805
13823
|
const positionsCount = positions.length;
|
|
13806
13824
|
const openOrdersCount = useMemo(
|
|
13807
13825
|
() => openOrders.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
|
|
@@ -13826,25 +13844,25 @@ function PortfolioActivityPanel({
|
|
|
13826
13844
|
const activeDataLength = (() => {
|
|
13827
13845
|
switch (activeTab) {
|
|
13828
13846
|
case "subscriptions":
|
|
13829
|
-
return
|
|
13847
|
+
return sortedOfferingOrders.length;
|
|
13830
13848
|
case "open-orders":
|
|
13831
|
-
return
|
|
13849
|
+
return sortedOpenOrders.length;
|
|
13832
13850
|
case "orders":
|
|
13833
13851
|
return mergedOrderHistory.length;
|
|
13834
13852
|
case "trades":
|
|
13835
|
-
return
|
|
13853
|
+
return sortedTradeHistory.length;
|
|
13836
13854
|
case "transfers":
|
|
13837
|
-
return
|
|
13855
|
+
return sortedTransfers.length;
|
|
13838
13856
|
default:
|
|
13839
13857
|
return 0;
|
|
13840
13858
|
}
|
|
13841
13859
|
})();
|
|
13842
13860
|
const totalPages = Math.ceil(activeDataLength / pageSize);
|
|
13843
|
-
const pagedOfferingOrders =
|
|
13844
|
-
const pagedOpenOrders =
|
|
13861
|
+
const pagedOfferingOrders = sortedOfferingOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
|
|
13862
|
+
const pagedOpenOrders = sortedOpenOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
|
|
13845
13863
|
const pagedOrderHistory = mergedOrderHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
|
|
13846
|
-
const pagedTradeHistory =
|
|
13847
|
-
const pagedTransfers =
|
|
13864
|
+
const pagedTradeHistory = sortedTradeHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
|
|
13865
|
+
const pagedTransfers = sortedTransfers.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
|
|
13848
13866
|
return /* @__PURE__ */ jsxs(Container2, { className, style, children: [
|
|
13849
13867
|
/* @__PURE__ */ jsx(PanelTitle, { children: "Activity" }),
|
|
13850
13868
|
/* @__PURE__ */ jsxs(TabContainer, { children: [
|