@loafmarkets/ui 0.1.291 → 0.1.292
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 +8 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -13638,7 +13638,6 @@ function PortfolioActivityPanel({
|
|
|
13638
13638
|
}) {
|
|
13639
13639
|
const resolvedDefaultTab = defaultTab ?? (showPositionsTab ? "positions" : showSubscriptionsTab ? "subscriptions" : "orders");
|
|
13640
13640
|
const [activeTab, setActiveTab] = useState(resolvedDefaultTab);
|
|
13641
|
-
const [activityPage, setActivityPage] = useState(0);
|
|
13642
13641
|
const [pendingCancelOrderId, setPendingCancelOrderId] = useState(null);
|
|
13643
13642
|
const [cancelAllConfirmOpen, setCancelAllConfirmOpen] = useState(false);
|
|
13644
13643
|
const [cancellingAll, setCancellingAll] = useState(false);
|
|
@@ -13741,7 +13740,7 @@ function PortfolioActivityPanel({
|
|
|
13741
13740
|
}));
|
|
13742
13741
|
return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
|
|
13743
13742
|
}, [showSubscriptionsTab, offeringOrders, orderHistory]);
|
|
13744
|
-
|
|
13743
|
+
useMemo(() => {
|
|
13745
13744
|
switch (activeTab) {
|
|
13746
13745
|
case "positions":
|
|
13747
13746
|
return positions.length;
|
|
@@ -13775,11 +13774,8 @@ function PortfolioActivityPanel({
|
|
|
13775
13774
|
}).length,
|
|
13776
13775
|
[offeringOrders]
|
|
13777
13776
|
);
|
|
13778
|
-
const activityTotalPages = Math.ceil(activeTabTotal / pageSize);
|
|
13779
|
-
const pageSlice = (arr) => arr.slice(activityPage * pageSize, (activityPage + 1) * pageSize);
|
|
13780
13777
|
const handleTabChange = (tab) => {
|
|
13781
13778
|
setActiveTab(tab);
|
|
13782
|
-
setActivityPage(0);
|
|
13783
13779
|
};
|
|
13784
13780
|
return /* @__PURE__ */ jsxs(Container3, { className, style, children: [
|
|
13785
13781
|
/* @__PURE__ */ jsx(PanelTitle, { children: "Activity" }),
|
|
@@ -13841,7 +13837,7 @@ function PortfolioActivityPanel({
|
|
|
13841
13837
|
onClosePosition && /* @__PURE__ */ jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
|
|
13842
13838
|
] })
|
|
13843
13839
|
] }),
|
|
13844
|
-
|
|
13840
|
+
sortedPositions.map((pos) => {
|
|
13845
13841
|
const currentValue = pos.quantity * pos.marketPrice;
|
|
13846
13842
|
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
13847
13843
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
@@ -13935,7 +13931,7 @@ function PortfolioActivityPanel({
|
|
|
13935
13931
|
] }),
|
|
13936
13932
|
onClosePosition && /* @__PURE__ */ jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
|
|
13937
13933
|
] }),
|
|
13938
|
-
|
|
13934
|
+
sortedPositions.map((pos) => {
|
|
13939
13935
|
const currentValue = pos.quantity * pos.marketPrice;
|
|
13940
13936
|
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
13941
13937
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
@@ -14012,7 +14008,7 @@ function PortfolioActivityPanel({
|
|
|
14012
14008
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14013
14009
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14014
14010
|
] }),
|
|
14015
|
-
|
|
14011
|
+
offeringOrders.map((order) => {
|
|
14016
14012
|
const meta = getOrderStatusMeta(order.status);
|
|
14017
14013
|
return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14018
14014
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
|
|
@@ -14039,7 +14035,7 @@ function PortfolioActivityPanel({
|
|
|
14039
14035
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14040
14036
|
onCancelOrder && /* @__PURE__ */ jsx(GridHeaderCell, {})
|
|
14041
14037
|
] }),
|
|
14042
|
-
|
|
14038
|
+
openOrders.map((order) => {
|
|
14043
14039
|
const meta = getOrderStatusMeta(order.status);
|
|
14044
14040
|
const isMarket = order.type === "MARKET";
|
|
14045
14041
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14084,7 +14080,7 @@ function PortfolioActivityPanel({
|
|
|
14084
14080
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14085
14081
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14086
14082
|
] }),
|
|
14087
|
-
|
|
14083
|
+
mergedOrderHistory.map((order) => {
|
|
14088
14084
|
const meta = getOrderStatusMeta(order.status);
|
|
14089
14085
|
const isMarket = order.type === "MARKET";
|
|
14090
14086
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14117,7 +14113,7 @@ function PortfolioActivityPanel({
|
|
|
14117
14113
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Fee" }),
|
|
14118
14114
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14119
14115
|
] }),
|
|
14120
|
-
|
|
14116
|
+
tradeHistory.map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14121
14117
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: trade.tokenName }) }),
|
|
14122
14118
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
|
|
14123
14119
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
|
|
@@ -14138,7 +14134,7 @@ function PortfolioActivityPanel({
|
|
|
14138
14134
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14139
14135
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14140
14136
|
] }),
|
|
14141
|
-
|
|
14137
|
+
transfers.map((t, idx) => {
|
|
14142
14138
|
const isDeposit = t.type === "DEPOSIT";
|
|
14143
14139
|
const statusMeta = getOrderStatusMeta(t.status);
|
|
14144
14140
|
return /* @__PURE__ */ jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
|
|
@@ -14153,31 +14149,6 @@ function PortfolioActivityPanel({
|
|
|
14153
14149
|
] }, t.blockchainTxHash ?? `transfer-${idx}`);
|
|
14154
14150
|
})
|
|
14155
14151
|
] })
|
|
14156
|
-
] }),
|
|
14157
|
-
activityTotalPages > 1 && /* @__PURE__ */ jsxs(PaginationRow, { children: [
|
|
14158
|
-
/* @__PURE__ */ jsx(
|
|
14159
|
-
PaginationButton,
|
|
14160
|
-
{
|
|
14161
|
-
type: "button",
|
|
14162
|
-
onClick: () => setActivityPage((p) => p - 1),
|
|
14163
|
-
disabled: activityPage === 0,
|
|
14164
|
-
children: "\u2190 Prev"
|
|
14165
|
-
}
|
|
14166
|
-
),
|
|
14167
|
-
/* @__PURE__ */ jsxs(PaginationLabel, { children: [
|
|
14168
|
-
activityPage + 1,
|
|
14169
|
-
" / ",
|
|
14170
|
-
activityTotalPages
|
|
14171
|
-
] }),
|
|
14172
|
-
/* @__PURE__ */ jsx(
|
|
14173
|
-
PaginationButton,
|
|
14174
|
-
{
|
|
14175
|
-
type: "button",
|
|
14176
|
-
onClick: () => setActivityPage((p) => p + 1),
|
|
14177
|
-
disabled: activityPage >= activityTotalPages - 1,
|
|
14178
|
-
children: "Next \u2192"
|
|
14179
|
-
}
|
|
14180
|
-
)
|
|
14181
14152
|
] })
|
|
14182
14153
|
] }),
|
|
14183
14154
|
cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
|
|
@@ -14392,33 +14363,6 @@ var EmptyState = styled9.div`
|
|
|
14392
14363
|
font-size: 0.8rem;
|
|
14393
14364
|
color: rgba(255, 255, 255, 0.45);
|
|
14394
14365
|
`;
|
|
14395
|
-
var PaginationRow = styled9.div`
|
|
14396
|
-
display: flex;
|
|
14397
|
-
align-items: center;
|
|
14398
|
-
justify-content: center;
|
|
14399
|
-
gap: 0.75rem;
|
|
14400
|
-
margin-top: 1rem;
|
|
14401
|
-
padding-top: 1rem;
|
|
14402
|
-
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
|
14403
|
-
`;
|
|
14404
|
-
var PaginationButton = styled9.button`
|
|
14405
|
-
background: transparent;
|
|
14406
|
-
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
14407
|
-
border-radius: 8px;
|
|
14408
|
-
padding: 0.35rem 0.75rem;
|
|
14409
|
-
font-size: 0.8rem;
|
|
14410
|
-
cursor: pointer;
|
|
14411
|
-
color: rgba(255, 255, 255, 0.7);
|
|
14412
|
-
|
|
14413
|
-
&:disabled {
|
|
14414
|
-
color: rgba(255, 255, 255, 0.2);
|
|
14415
|
-
cursor: default;
|
|
14416
|
-
}
|
|
14417
|
-
`;
|
|
14418
|
-
var PaginationLabel = styled9.span`
|
|
14419
|
-
font-size: 0.8rem;
|
|
14420
|
-
color: rgba(255, 255, 255, 0.4);
|
|
14421
|
-
`;
|
|
14422
14366
|
var PositionsHeader = styled9.div`
|
|
14423
14367
|
display: grid;
|
|
14424
14368
|
grid-template-columns: ${(p) => p.$hasClose ? "repeat(6, 1fr) minmax(130px, auto)" : "repeat(6, 1fr)"};
|