@loafmarkets/ui 0.1.291 → 0.1.293
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 +10 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13664,7 +13664,6 @@ function PortfolioActivityPanel({
|
|
|
13664
13664
|
}) {
|
|
13665
13665
|
const resolvedDefaultTab = defaultTab ?? (showPositionsTab ? "positions" : showSubscriptionsTab ? "subscriptions" : "orders");
|
|
13666
13666
|
const [activeTab, setActiveTab] = React5.useState(resolvedDefaultTab);
|
|
13667
|
-
const [activityPage, setActivityPage] = React5.useState(0);
|
|
13668
13667
|
const [pendingCancelOrderId, setPendingCancelOrderId] = React5.useState(null);
|
|
13669
13668
|
const [cancelAllConfirmOpen, setCancelAllConfirmOpen] = React5.useState(false);
|
|
13670
13669
|
const [cancellingAll, setCancellingAll] = React5.useState(false);
|
|
@@ -13767,7 +13766,7 @@ function PortfolioActivityPanel({
|
|
|
13767
13766
|
}));
|
|
13768
13767
|
return [...orderHistory, ...mapped].sort((a, b) => b.createdAt - a.createdAt);
|
|
13769
13768
|
}, [showSubscriptionsTab, offeringOrders, orderHistory]);
|
|
13770
|
-
|
|
13769
|
+
React5.useMemo(() => {
|
|
13771
13770
|
switch (activeTab) {
|
|
13772
13771
|
case "positions":
|
|
13773
13772
|
return positions.length;
|
|
@@ -13801,11 +13800,8 @@ function PortfolioActivityPanel({
|
|
|
13801
13800
|
}).length,
|
|
13802
13801
|
[offeringOrders]
|
|
13803
13802
|
);
|
|
13804
|
-
const activityTotalPages = Math.ceil(activeTabTotal / pageSize);
|
|
13805
|
-
const pageSlice = (arr) => arr.slice(activityPage * pageSize, (activityPage + 1) * pageSize);
|
|
13806
13803
|
const handleTabChange = (tab) => {
|
|
13807
13804
|
setActiveTab(tab);
|
|
13808
|
-
setActivityPage(0);
|
|
13809
13805
|
};
|
|
13810
13806
|
return /* @__PURE__ */ jsxRuntime.jsxs(Container3, { className, style, children: [
|
|
13811
13807
|
/* @__PURE__ */ jsxRuntime.jsx(PanelTitle, { children: "Activity" }),
|
|
@@ -13867,7 +13863,7 @@ function PortfolioActivityPanel({
|
|
|
13867
13863
|
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
|
|
13868
13864
|
] })
|
|
13869
13865
|
] }),
|
|
13870
|
-
|
|
13866
|
+
sortedPositions.map((pos) => {
|
|
13871
13867
|
const currentValue = pos.quantity * pos.marketPrice;
|
|
13872
13868
|
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
13873
13869
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
@@ -13882,10 +13878,7 @@ function PortfolioActivityPanel({
|
|
|
13882
13878
|
onPositionClick?.(pos.tokenName, pos.isIpoAllocation);
|
|
13883
13879
|
}, children: [
|
|
13884
13880
|
/* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "Asset" }),
|
|
13885
|
-
/* @__PURE__ */ jsxRuntime.
|
|
13886
|
-
pos.imageUrl && /* @__PURE__ */ jsxRuntime.jsx(CAssetLogo, { src: pos.imageUrl, alt: "" }),
|
|
13887
|
-
pos.tokenName
|
|
13888
|
-
] })
|
|
13881
|
+
/* @__PURE__ */ jsxRuntime.jsx(CAssetName, { children: pos.tokenName })
|
|
13889
13882
|
] }),
|
|
13890
13883
|
/* @__PURE__ */ jsxRuntime.jsxs(CUnitsCell, { children: [
|
|
13891
13884
|
/* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "Units" }),
|
|
@@ -13961,7 +13954,7 @@ function PortfolioActivityPanel({
|
|
|
13961
13954
|
] }),
|
|
13962
13955
|
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
|
|
13963
13956
|
] }),
|
|
13964
|
-
|
|
13957
|
+
sortedPositions.map((pos) => {
|
|
13965
13958
|
const currentValue = pos.quantity * pos.marketPrice;
|
|
13966
13959
|
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
13967
13960
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
@@ -14038,7 +14031,7 @@ function PortfolioActivityPanel({
|
|
|
14038
14031
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
|
|
14039
14032
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Date" })
|
|
14040
14033
|
] }),
|
|
14041
|
-
|
|
14034
|
+
offeringOrders.map((order) => {
|
|
14042
14035
|
const meta = getOrderStatusMeta(order.status);
|
|
14043
14036
|
return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14044
14037
|
/* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $primary: true, children: order.tokenName }) }),
|
|
@@ -14065,7 +14058,7 @@ function PortfolioActivityPanel({
|
|
|
14065
14058
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
|
|
14066
14059
|
onCancelOrder && /* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, {})
|
|
14067
14060
|
] }),
|
|
14068
|
-
|
|
14061
|
+
openOrders.map((order) => {
|
|
14069
14062
|
const meta = getOrderStatusMeta(order.status);
|
|
14070
14063
|
const isMarket = order.type === "MARKET";
|
|
14071
14064
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14110,7 +14103,7 @@ function PortfolioActivityPanel({
|
|
|
14110
14103
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
|
|
14111
14104
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Date" })
|
|
14112
14105
|
] }),
|
|
14113
|
-
|
|
14106
|
+
mergedOrderHistory.map((order) => {
|
|
14114
14107
|
const meta = getOrderStatusMeta(order.status);
|
|
14115
14108
|
const isMarket = order.type === "MARKET";
|
|
14116
14109
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14143,7 +14136,7 @@ function PortfolioActivityPanel({
|
|
|
14143
14136
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Fee" }),
|
|
14144
14137
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Date" })
|
|
14145
14138
|
] }),
|
|
14146
|
-
|
|
14139
|
+
tradeHistory.map((trade) => /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14147
14140
|
/* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { $primary: true, children: trade.tokenName }) }),
|
|
14148
14141
|
/* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
|
|
14149
14142
|
/* @__PURE__ */ jsxRuntime.jsx(GridCell, { children: /* @__PURE__ */ jsxRuntime.jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
|
|
@@ -14164,7 +14157,7 @@ function PortfolioActivityPanel({
|
|
|
14164
14157
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Status" }),
|
|
14165
14158
|
/* @__PURE__ */ jsxRuntime.jsx(GridHeaderCell, { children: "Date" })
|
|
14166
14159
|
] }),
|
|
14167
|
-
|
|
14160
|
+
transfers.map((t, idx) => {
|
|
14168
14161
|
const isDeposit = t.type === "DEPOSIT";
|
|
14169
14162
|
const statusMeta = getOrderStatusMeta(t.status);
|
|
14170
14163
|
return /* @__PURE__ */ jsxRuntime.jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
|
|
@@ -14179,31 +14172,6 @@ function PortfolioActivityPanel({
|
|
|
14179
14172
|
] }, t.blockchainTxHash ?? `transfer-${idx}`);
|
|
14180
14173
|
})
|
|
14181
14174
|
] })
|
|
14182
|
-
] }),
|
|
14183
|
-
activityTotalPages > 1 && /* @__PURE__ */ jsxRuntime.jsxs(PaginationRow, { children: [
|
|
14184
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14185
|
-
PaginationButton,
|
|
14186
|
-
{
|
|
14187
|
-
type: "button",
|
|
14188
|
-
onClick: () => setActivityPage((p) => p - 1),
|
|
14189
|
-
disabled: activityPage === 0,
|
|
14190
|
-
children: "\u2190 Prev"
|
|
14191
|
-
}
|
|
14192
|
-
),
|
|
14193
|
-
/* @__PURE__ */ jsxRuntime.jsxs(PaginationLabel, { children: [
|
|
14194
|
-
activityPage + 1,
|
|
14195
|
-
" / ",
|
|
14196
|
-
activityTotalPages
|
|
14197
|
-
] }),
|
|
14198
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14199
|
-
PaginationButton,
|
|
14200
|
-
{
|
|
14201
|
-
type: "button",
|
|
14202
|
-
onClick: () => setActivityPage((p) => p + 1),
|
|
14203
|
-
disabled: activityPage >= activityTotalPages - 1,
|
|
14204
|
-
children: "Next \u2192"
|
|
14205
|
-
}
|
|
14206
|
-
)
|
|
14207
14175
|
] })
|
|
14208
14176
|
] }),
|
|
14209
14177
|
cancelAllConfirmOpen && /* @__PURE__ */ jsxRuntime.jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxRuntime.jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
|
|
@@ -14418,33 +14386,6 @@ var EmptyState = styled9__default.default.div`
|
|
|
14418
14386
|
font-size: 0.8rem;
|
|
14419
14387
|
color: rgba(255, 255, 255, 0.45);
|
|
14420
14388
|
`;
|
|
14421
|
-
var PaginationRow = styled9__default.default.div`
|
|
14422
|
-
display: flex;
|
|
14423
|
-
align-items: center;
|
|
14424
|
-
justify-content: center;
|
|
14425
|
-
gap: 0.75rem;
|
|
14426
|
-
margin-top: 1rem;
|
|
14427
|
-
padding-top: 1rem;
|
|
14428
|
-
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
|
14429
|
-
`;
|
|
14430
|
-
var PaginationButton = styled9__default.default.button`
|
|
14431
|
-
background: transparent;
|
|
14432
|
-
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
14433
|
-
border-radius: 8px;
|
|
14434
|
-
padding: 0.35rem 0.75rem;
|
|
14435
|
-
font-size: 0.8rem;
|
|
14436
|
-
cursor: pointer;
|
|
14437
|
-
color: rgba(255, 255, 255, 0.7);
|
|
14438
|
-
|
|
14439
|
-
&:disabled {
|
|
14440
|
-
color: rgba(255, 255, 255, 0.2);
|
|
14441
|
-
cursor: default;
|
|
14442
|
-
}
|
|
14443
|
-
`;
|
|
14444
|
-
var PaginationLabel = styled9__default.default.span`
|
|
14445
|
-
font-size: 0.8rem;
|
|
14446
|
-
color: rgba(255, 255, 255, 0.4);
|
|
14447
|
-
`;
|
|
14448
14389
|
var PositionsHeader = styled9__default.default.div`
|
|
14449
14390
|
display: grid;
|
|
14450
14391
|
grid-template-columns: ${(p) => p.$hasClose ? "repeat(6, 1fr) minmax(130px, auto)" : "repeat(6, 1fr)"};
|
|
@@ -14943,7 +14884,7 @@ var CAssetName = styled9__default.default.div`
|
|
|
14943
14884
|
align-items: center;
|
|
14944
14885
|
gap: 0.3rem;
|
|
14945
14886
|
`;
|
|
14946
|
-
|
|
14887
|
+
styled9__default.default.img`
|
|
14947
14888
|
width: 22px;
|
|
14948
14889
|
height: 22px;
|
|
14949
14890
|
border-radius: 4px;
|