@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.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;
|
|
@@ -13856,10 +13852,7 @@ function PortfolioActivityPanel({
|
|
|
13856
13852
|
onPositionClick?.(pos.tokenName, pos.isIpoAllocation);
|
|
13857
13853
|
}, children: [
|
|
13858
13854
|
/* @__PURE__ */ jsx(CCellLabel, { children: "Asset" }),
|
|
13859
|
-
/* @__PURE__ */
|
|
13860
|
-
pos.imageUrl && /* @__PURE__ */ jsx(CAssetLogo, { src: pos.imageUrl, alt: "" }),
|
|
13861
|
-
pos.tokenName
|
|
13862
|
-
] })
|
|
13855
|
+
/* @__PURE__ */ jsx(CAssetName, { children: pos.tokenName })
|
|
13863
13856
|
] }),
|
|
13864
13857
|
/* @__PURE__ */ jsxs(CUnitsCell, { children: [
|
|
13865
13858
|
/* @__PURE__ */ jsx(CCellLabel, { children: "Units" }),
|
|
@@ -13935,7 +13928,7 @@ function PortfolioActivityPanel({
|
|
|
13935
13928
|
] }),
|
|
13936
13929
|
onClosePosition && /* @__PURE__ */ jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
|
|
13937
13930
|
] }),
|
|
13938
|
-
|
|
13931
|
+
sortedPositions.map((pos) => {
|
|
13939
13932
|
const currentValue = pos.quantity * pos.marketPrice;
|
|
13940
13933
|
const costBasis = pos.quantity * pos.averageEntryPrice;
|
|
13941
13934
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
@@ -14012,7 +14005,7 @@ function PortfolioActivityPanel({
|
|
|
14012
14005
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14013
14006
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14014
14007
|
] }),
|
|
14015
|
-
|
|
14008
|
+
offeringOrders.map((order) => {
|
|
14016
14009
|
const meta = getOrderStatusMeta(order.status);
|
|
14017
14010
|
return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14018
14011
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
|
|
@@ -14039,7 +14032,7 @@ function PortfolioActivityPanel({
|
|
|
14039
14032
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14040
14033
|
onCancelOrder && /* @__PURE__ */ jsx(GridHeaderCell, {})
|
|
14041
14034
|
] }),
|
|
14042
|
-
|
|
14035
|
+
openOrders.map((order) => {
|
|
14043
14036
|
const meta = getOrderStatusMeta(order.status);
|
|
14044
14037
|
const isMarket = order.type === "MARKET";
|
|
14045
14038
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14084,7 +14077,7 @@ function PortfolioActivityPanel({
|
|
|
14084
14077
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14085
14078
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14086
14079
|
] }),
|
|
14087
|
-
|
|
14080
|
+
mergedOrderHistory.map((order) => {
|
|
14088
14081
|
const meta = getOrderStatusMeta(order.status);
|
|
14089
14082
|
const isMarket = order.type === "MARKET";
|
|
14090
14083
|
const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
|
|
@@ -14117,7 +14110,7 @@ function PortfolioActivityPanel({
|
|
|
14117
14110
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Fee" }),
|
|
14118
14111
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14119
14112
|
] }),
|
|
14120
|
-
|
|
14113
|
+
tradeHistory.map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
|
|
14121
14114
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: trade.tokenName }) }),
|
|
14122
14115
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
|
|
14123
14116
|
/* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
|
|
@@ -14138,7 +14131,7 @@ function PortfolioActivityPanel({
|
|
|
14138
14131
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
|
|
14139
14132
|
/* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
|
|
14140
14133
|
] }),
|
|
14141
|
-
|
|
14134
|
+
transfers.map((t, idx) => {
|
|
14142
14135
|
const isDeposit = t.type === "DEPOSIT";
|
|
14143
14136
|
const statusMeta = getOrderStatusMeta(t.status);
|
|
14144
14137
|
return /* @__PURE__ */ jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
|
|
@@ -14153,31 +14146,6 @@ function PortfolioActivityPanel({
|
|
|
14153
14146
|
] }, t.blockchainTxHash ?? `transfer-${idx}`);
|
|
14154
14147
|
})
|
|
14155
14148
|
] })
|
|
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
14149
|
] })
|
|
14182
14150
|
] }),
|
|
14183
14151
|
cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
|
|
@@ -14392,33 +14360,6 @@ var EmptyState = styled9.div`
|
|
|
14392
14360
|
font-size: 0.8rem;
|
|
14393
14361
|
color: rgba(255, 255, 255, 0.45);
|
|
14394
14362
|
`;
|
|
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
14363
|
var PositionsHeader = styled9.div`
|
|
14423
14364
|
display: grid;
|
|
14424
14365
|
grid-template-columns: ${(p) => p.$hasClose ? "repeat(6, 1fr) minmax(130px, auto)" : "repeat(6, 1fr)"};
|
|
@@ -14917,7 +14858,7 @@ var CAssetName = styled9.div`
|
|
|
14917
14858
|
align-items: center;
|
|
14918
14859
|
gap: 0.3rem;
|
|
14919
14860
|
`;
|
|
14920
|
-
|
|
14861
|
+
styled9.img`
|
|
14921
14862
|
width: 22px;
|
|
14922
14863
|
height: 22px;
|
|
14923
14864
|
border-radius: 4px;
|