@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 CHANGED
@@ -13807,7 +13807,9 @@ function PortfolioActivityPanel({
13807
13807
  }
13808
13808
  };
13809
13809
  const mergedOrderHistory = React5.useMemo(() => {
13810
- if (showSubscriptionsTab || offeringOrders.length === 0) return orderHistory;
13810
+ if (showSubscriptionsTab || offeringOrders.length === 0) {
13811
+ return [...orderHistory].sort((a, b) => b.createdAt - a.createdAt);
13812
+ }
13811
13813
  const mapped = offeringOrders.map((o, i) => ({
13812
13814
  id: o.ipoOrderId ?? -(i + 1),
13813
13815
  propertyId: 0,
@@ -13828,6 +13830,22 @@ function PortfolioActivityPanel({
13828
13830
  }));
13829
13831
  return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
13830
13832
  }, [showSubscriptionsTab, offeringOrders, orderHistory]);
13833
+ const sortedOpenOrders = React5.useMemo(
13834
+ () => [...openOrders].sort((a, b) => b.createdAt - a.createdAt),
13835
+ [openOrders]
13836
+ );
13837
+ const sortedOfferingOrders = React5.useMemo(
13838
+ () => [...offeringOrders].sort((a, b) => b.createdAt - a.createdAt),
13839
+ [offeringOrders]
13840
+ );
13841
+ const sortedTradeHistory = React5.useMemo(
13842
+ () => [...tradeHistory].sort((a, b) => b.executedAt - a.executedAt),
13843
+ [tradeHistory]
13844
+ );
13845
+ const sortedTransfers = React5.useMemo(
13846
+ () => [...transfers].sort((a, b) => b.createdAt - a.createdAt),
13847
+ [transfers]
13848
+ );
13831
13849
  const positionsCount = positions.length;
13832
13850
  const openOrdersCount = React5.useMemo(
13833
13851
  () => openOrders.filter((o) => o.status === "OPEN" || o.status === "PARTIALLY_FILLED").length,
@@ -13852,25 +13870,25 @@ function PortfolioActivityPanel({
13852
13870
  const activeDataLength = (() => {
13853
13871
  switch (activeTab) {
13854
13872
  case "subscriptions":
13855
- return offeringOrders.length;
13873
+ return sortedOfferingOrders.length;
13856
13874
  case "open-orders":
13857
- return openOrders.length;
13875
+ return sortedOpenOrders.length;
13858
13876
  case "orders":
13859
13877
  return mergedOrderHistory.length;
13860
13878
  case "trades":
13861
- return tradeHistory.length;
13879
+ return sortedTradeHistory.length;
13862
13880
  case "transfers":
13863
- return transfers.length;
13881
+ return sortedTransfers.length;
13864
13882
  default:
13865
13883
  return 0;
13866
13884
  }
13867
13885
  })();
13868
13886
  const totalPages = Math.ceil(activeDataLength / pageSize);
13869
- const pagedOfferingOrders = offeringOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13870
- const pagedOpenOrders = openOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13887
+ const pagedOfferingOrders = sortedOfferingOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13888
+ const pagedOpenOrders = sortedOpenOrders.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13871
13889
  const pagedOrderHistory = mergedOrderHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13872
- const pagedTradeHistory = tradeHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13873
- const pagedTransfers = transfers.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13890
+ const pagedTradeHistory = sortedTradeHistory.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13891
+ const pagedTransfers = sortedTransfers.slice(currentPage * pageSize, (currentPage + 1) * pageSize);
13874
13892
  return /* @__PURE__ */ jsxRuntime.jsxs(Container2, { className, style, children: [
13875
13893
  /* @__PURE__ */ jsxRuntime.jsx(PanelTitle, { children: "Activity" }),
13876
13894
  /* @__PURE__ */ jsxRuntime.jsxs(TabContainer, { children: [