@loafmarkets/ui 0.1.385 → 0.1.387
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.d.mts +29 -15
- package/dist/index.d.ts +29 -15
- package/dist/index.js +113 -249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -249
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -5061,15 +5061,7 @@ function useIsNarrow(maxWidthPx = 768) {
|
|
|
5061
5061
|
}, [query]);
|
|
5062
5062
|
return narrow;
|
|
5063
5063
|
}
|
|
5064
|
-
var DEFAULT_TRADE_PATH = "/trade";
|
|
5065
5064
|
var DEFAULT_HOME_PATH = "/";
|
|
5066
|
-
var DEFAULT_ABOUT_PATH = "/about";
|
|
5067
|
-
var DEFAULT_LEARN_PATH = "/learn";
|
|
5068
|
-
var DEFAULT_API_PATH = "/api";
|
|
5069
|
-
var DEFAULT_PROPERTY_MAP_PATH = "/map";
|
|
5070
|
-
var DEFAULT_LEADERBOARD_PATH = "/league";
|
|
5071
|
-
var DEFAULT_LEADERBOARD_PAGE_PATH = "/leaderboard";
|
|
5072
|
-
var DEFAULT_PORTFOLIO_PATH = "/portfolio";
|
|
5073
5065
|
var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
|
|
5074
5066
|
var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
|
|
5075
5067
|
var LOGIN_POPUP_EVENT = "loaf:open-login-popup";
|
|
@@ -5077,21 +5069,13 @@ var Header = ({
|
|
|
5077
5069
|
currentUser,
|
|
5078
5070
|
isAuthenticated = false,
|
|
5079
5071
|
locationPath = DEFAULT_HOME_PATH,
|
|
5080
|
-
|
|
5072
|
+
navItems,
|
|
5073
|
+
activeKey,
|
|
5081
5074
|
onNavigate,
|
|
5082
5075
|
onLogout,
|
|
5083
5076
|
onSignInClick,
|
|
5084
5077
|
loginPopupComponent: LoginPopupComponent,
|
|
5085
|
-
tradePath = DEFAULT_TRADE_PATH,
|
|
5086
5078
|
homePath = DEFAULT_HOME_PATH,
|
|
5087
|
-
aboutPath = DEFAULT_ABOUT_PATH,
|
|
5088
|
-
learnPath = DEFAULT_LEARN_PATH,
|
|
5089
|
-
apiPath = DEFAULT_API_PATH,
|
|
5090
|
-
offeringsPath,
|
|
5091
|
-
propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
|
|
5092
|
-
leaderboardPath = DEFAULT_LEADERBOARD_PATH,
|
|
5093
|
-
leaderboardPagePath = DEFAULT_LEADERBOARD_PAGE_PATH,
|
|
5094
|
-
portfolioPath = DEFAULT_PORTFOLIO_PATH,
|
|
5095
5079
|
loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
|
|
5096
5080
|
authLoginUrl,
|
|
5097
5081
|
authReturnParam = DEFAULT_AUTH_RETURN_PARAM,
|
|
@@ -5099,12 +5083,10 @@ var Header = ({
|
|
|
5099
5083
|
logoHref,
|
|
5100
5084
|
onLogoClick,
|
|
5101
5085
|
onLoafLiquidityClick,
|
|
5102
|
-
onTradeClick,
|
|
5103
5086
|
onProfileNavigate: _onProfileNavigate,
|
|
5104
5087
|
onOrdersNavigate: _onOrdersNavigate,
|
|
5105
5088
|
onWalletNavigate: _onWalletNavigate,
|
|
5106
5089
|
onSettingsClick,
|
|
5107
|
-
showTradeTab = true,
|
|
5108
5090
|
portfolioSummary,
|
|
5109
5091
|
fundsPending = false,
|
|
5110
5092
|
transparentOnTop = false
|
|
@@ -5248,10 +5230,6 @@ var Header = ({
|
|
|
5248
5230
|
window.location.href = path;
|
|
5249
5231
|
}
|
|
5250
5232
|
};
|
|
5251
|
-
const handleNavigation = (path) => {
|
|
5252
|
-
closeMenus();
|
|
5253
|
-
performNavigation(path);
|
|
5254
|
-
};
|
|
5255
5233
|
const handleLogoNavigation = (event) => {
|
|
5256
5234
|
event.preventDefault();
|
|
5257
5235
|
closeMenus();
|
|
@@ -5269,16 +5247,19 @@ var Header = ({
|
|
|
5269
5247
|
}
|
|
5270
5248
|
performNavigation(resolvedLoafLiquidityPath);
|
|
5271
5249
|
};
|
|
5272
|
-
const
|
|
5273
|
-
|
|
5250
|
+
const handleNavItem = (item) => {
|
|
5251
|
+
closeMenus();
|
|
5252
|
+
if (item.onSelect) {
|
|
5253
|
+
item.onSelect();
|
|
5274
5254
|
return;
|
|
5275
5255
|
}
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5256
|
+
if (item.external) {
|
|
5257
|
+
if (typeof window !== "undefined") {
|
|
5258
|
+
window.open(item.path, "_blank", "noopener,noreferrer");
|
|
5259
|
+
}
|
|
5279
5260
|
return;
|
|
5280
5261
|
}
|
|
5281
|
-
performNavigation(
|
|
5262
|
+
performNavigation(item.path);
|
|
5282
5263
|
};
|
|
5283
5264
|
const handleLogoutClick = async (event) => {
|
|
5284
5265
|
event?.preventDefault();
|
|
@@ -5356,42 +5337,23 @@ var Header = ({
|
|
|
5356
5337
|
setShowLoginPopup(false);
|
|
5357
5338
|
setLoginPopupInitialView(void 0);
|
|
5358
5339
|
}, []);
|
|
5359
|
-
const resolvedTradePath = tradePath ?? DEFAULT_TRADE_PATH;
|
|
5360
5340
|
const resolvedHomePath = homePath ?? DEFAULT_HOME_PATH;
|
|
5361
|
-
const resolvedAboutPath = aboutPath ?? DEFAULT_ABOUT_PATH;
|
|
5362
|
-
const resolvedLearnPath = learnPath ?? DEFAULT_LEARN_PATH;
|
|
5363
|
-
const resolvedApiPath = apiPath ?? DEFAULT_API_PATH;
|
|
5364
|
-
const resolvedOfferingsPath = offeringsPath ?? void 0;
|
|
5365
|
-
const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
|
|
5366
|
-
const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
|
|
5367
|
-
const resolvedLeaderboardPath = leaderboardPath ?? DEFAULT_LEADERBOARD_PATH;
|
|
5368
|
-
const resolvedLeaderboardPagePath = leaderboardPagePath ?? DEFAULT_LEADERBOARD_PAGE_PATH;
|
|
5369
|
-
const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
|
|
5370
5341
|
const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
|
|
5371
|
-
const
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
if (
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
const homeActive = resolvedActiveTab === "home";
|
|
5387
|
-
const offeringsActive = resolvedActiveTab === "offerings";
|
|
5388
|
-
const propertyMapActive = resolvedActiveTab === "propertyMap";
|
|
5389
|
-
const leaderboardActive = resolvedActiveTab === "leaderboard";
|
|
5390
|
-
const leaderboardPageActive = resolvedActiveTab === "leaderboardPage";
|
|
5391
|
-
const aboutActive = resolvedActiveTab === "about";
|
|
5392
|
-
const portfolioActive = resolvedActiveTab === "portfolio";
|
|
5393
|
-
const learnActive = resolvedActiveTab === "learn";
|
|
5394
|
-
const apiActive = resolvedActiveTab === "api";
|
|
5342
|
+
const inferredActiveKey = navItems.find(
|
|
5343
|
+
(item) => item.external ? false : item.match === "prefix" ? locationPath.startsWith(item.path) : locationPath === item.path
|
|
5344
|
+
)?.key ?? null;
|
|
5345
|
+
const resolvedActiveKey = activeKey ?? inferredActiveKey;
|
|
5346
|
+
const primaryItems = navItems.filter((item) => (item.group ?? "primary") === "primary");
|
|
5347
|
+
const moreItems = navItems.filter((item) => item.group === "more");
|
|
5348
|
+
const moreActive = moreItems.some((item) => item.key === resolvedActiveKey);
|
|
5349
|
+
const navLinkClick = (item) => (event) => {
|
|
5350
|
+
if (item.external) {
|
|
5351
|
+
closeMenus();
|
|
5352
|
+
return;
|
|
5353
|
+
}
|
|
5354
|
+
event.preventDefault();
|
|
5355
|
+
handleNavItem(item);
|
|
5356
|
+
};
|
|
5395
5357
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5396
5358
|
/* @__PURE__ */ jsxRuntime.jsx(SafeAreaCover, {}),
|
|
5397
5359
|
/* @__PURE__ */ jsxRuntime.jsx(Overlay, { $isOpen: isMobileMenuOpen, onClick: () => setIsMobileMenuOpen(false) }),
|
|
@@ -5408,108 +5370,23 @@ var Header = ({
|
|
|
5408
5370
|
style: { display: "flex", flexDirection: "row", alignItems: "center", height: "56px" },
|
|
5409
5371
|
className: "desktop-nav",
|
|
5410
5372
|
children: [
|
|
5411
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5412
|
-
NavLink,
|
|
5413
|
-
{
|
|
5414
|
-
href: resolvedHomePath,
|
|
5415
|
-
className: homeActive ? "active" : "",
|
|
5416
|
-
onClick: (event) => {
|
|
5417
|
-
event.preventDefault();
|
|
5418
|
-
handleNavigation(resolvedHomePath);
|
|
5419
|
-
},
|
|
5420
|
-
children: "Home"
|
|
5421
|
-
}
|
|
5422
|
-
),
|
|
5423
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5424
|
-
NavLink,
|
|
5425
|
-
{
|
|
5426
|
-
href: resolvedPortfolioPath,
|
|
5427
|
-
className: portfolioActive ? "active" : "",
|
|
5428
|
-
onClick: (event) => {
|
|
5429
|
-
event.preventDefault();
|
|
5430
|
-
handleNavigation(resolvedPortfolioPath);
|
|
5431
|
-
},
|
|
5432
|
-
children: "Portfolio"
|
|
5433
|
-
}
|
|
5434
|
-
),
|
|
5435
|
-
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5436
|
-
NavLink,
|
|
5437
|
-
{
|
|
5438
|
-
href: resolvedTradePath,
|
|
5439
|
-
className: tradeActive ? "active" : "",
|
|
5440
|
-
onClick: (event) => {
|
|
5441
|
-
event.preventDefault();
|
|
5442
|
-
handleTradeNavigation();
|
|
5443
|
-
},
|
|
5444
|
-
children: "Trade"
|
|
5445
|
-
}
|
|
5446
|
-
),
|
|
5447
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5448
|
-
NavLink,
|
|
5449
|
-
{
|
|
5450
|
-
href: offeringsHref,
|
|
5451
|
-
className: offeringsActive ? "active" : "",
|
|
5452
|
-
onClick: (event) => {
|
|
5453
|
-
event.preventDefault();
|
|
5454
|
-
handleNavigation(offeringsHref);
|
|
5455
|
-
},
|
|
5456
|
-
children: "Initial Offerings"
|
|
5457
|
-
}
|
|
5458
|
-
),
|
|
5459
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5460
|
-
NavLink,
|
|
5461
|
-
{
|
|
5462
|
-
href: resolvedPropertyMapPath,
|
|
5463
|
-
className: propertyMapActive ? "active" : "",
|
|
5464
|
-
onClick: (event) => {
|
|
5465
|
-
event.preventDefault();
|
|
5466
|
-
handleNavigation(resolvedPropertyMapPath);
|
|
5467
|
-
},
|
|
5468
|
-
children: "Property Map"
|
|
5469
|
-
}
|
|
5470
|
-
),
|
|
5471
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5373
|
+
primaryItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5472
5374
|
NavLink,
|
|
5473
5375
|
{
|
|
5474
|
-
href:
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5484
|
-
NavLink,
|
|
5485
|
-
{
|
|
5486
|
-
href: resolvedLeaderboardPagePath,
|
|
5487
|
-
className: leaderboardPageActive ? "active" : "",
|
|
5488
|
-
onClick: (event) => {
|
|
5489
|
-
event.preventDefault();
|
|
5490
|
-
handleNavigation(resolvedLeaderboardPagePath);
|
|
5491
|
-
},
|
|
5492
|
-
children: "Leaderboard"
|
|
5493
|
-
}
|
|
5494
|
-
),
|
|
5495
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5496
|
-
NavLink,
|
|
5497
|
-
{
|
|
5498
|
-
href: resolvedLearnPath,
|
|
5499
|
-
className: learnActive ? "active" : "",
|
|
5500
|
-
onClick: (event) => {
|
|
5501
|
-
event.preventDefault();
|
|
5502
|
-
handleNavigation(resolvedLearnPath);
|
|
5503
|
-
},
|
|
5504
|
-
children: "Learn"
|
|
5505
|
-
}
|
|
5506
|
-
),
|
|
5507
|
-
/* @__PURE__ */ jsxRuntime.jsxs(MoreMenu, { className: "more-menu", children: [
|
|
5376
|
+
href: item.path,
|
|
5377
|
+
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
5378
|
+
className: item.key === resolvedActiveKey ? "active" : "",
|
|
5379
|
+
onClick: navLinkClick(item),
|
|
5380
|
+
children: item.label
|
|
5381
|
+
},
|
|
5382
|
+
item.key
|
|
5383
|
+
)),
|
|
5384
|
+
moreItems.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(MoreMenu, { className: "more-menu", children: [
|
|
5508
5385
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5509
5386
|
MoreTrigger,
|
|
5510
5387
|
{
|
|
5511
5388
|
type: "button",
|
|
5512
|
-
className: `${isMoreMenuOpen ? "open" : ""} ${
|
|
5389
|
+
className: `${isMoreMenuOpen ? "open" : ""} ${moreActive ? "active" : ""}`,
|
|
5513
5390
|
"aria-haspopup": "true",
|
|
5514
5391
|
"aria-expanded": isMoreMenuOpen,
|
|
5515
5392
|
onClick: () => setIsMoreMenuOpen((open) => !open),
|
|
@@ -5519,42 +5396,17 @@ var Header = ({
|
|
|
5519
5396
|
]
|
|
5520
5397
|
}
|
|
5521
5398
|
),
|
|
5522
|
-
isMoreMenuOpen && /* @__PURE__ */ jsxRuntime.
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
}
|
|
5534
|
-
),
|
|
5535
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5536
|
-
MoreItem,
|
|
5537
|
-
{
|
|
5538
|
-
href: resolvedApiPath,
|
|
5539
|
-
className: apiActive ? "active" : "",
|
|
5540
|
-
onClick: (event) => {
|
|
5541
|
-
event.preventDefault();
|
|
5542
|
-
handleNavigation(resolvedApiPath);
|
|
5543
|
-
},
|
|
5544
|
-
children: "API"
|
|
5545
|
-
}
|
|
5546
|
-
),
|
|
5547
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5548
|
-
MoreItem,
|
|
5549
|
-
{
|
|
5550
|
-
href: "https://docs.loafmarkets.com/en/",
|
|
5551
|
-
target: "_blank",
|
|
5552
|
-
rel: "noopener noreferrer",
|
|
5553
|
-
onClick: () => setIsMoreMenuOpen(false),
|
|
5554
|
-
children: "Docs"
|
|
5555
|
-
}
|
|
5556
|
-
)
|
|
5557
|
-
] })
|
|
5399
|
+
isMoreMenuOpen && /* @__PURE__ */ jsxRuntime.jsx(MoreDropdown, { children: moreItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5400
|
+
MoreItem,
|
|
5401
|
+
{
|
|
5402
|
+
href: item.path,
|
|
5403
|
+
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
5404
|
+
className: item.key === resolvedActiveKey ? "active" : "",
|
|
5405
|
+
onClick: navLinkClick(item),
|
|
5406
|
+
children: item.label
|
|
5407
|
+
},
|
|
5408
|
+
item.key
|
|
5409
|
+
)) })
|
|
5558
5410
|
] }),
|
|
5559
5411
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5560
5412
|
"div",
|
|
@@ -5577,31 +5429,7 @@ var Header = ({
|
|
|
5577
5429
|
),
|
|
5578
5430
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mobile-menu-content", children: [
|
|
5579
5431
|
/* @__PURE__ */ jsxRuntime.jsx(MobileMenuHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(MobileMenuClose, { onClick: () => setIsMobileMenuOpen(false), "aria-label": "Close menu", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) }) }) }),
|
|
5580
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () =>
|
|
5581
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5582
|
-
MobileNavItem,
|
|
5583
|
-
{
|
|
5584
|
-
onClick: () => handleNavigation(resolvedPortfolioPath),
|
|
5585
|
-
children: "Portfolio"
|
|
5586
|
-
}
|
|
5587
|
-
),
|
|
5588
|
-
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5589
|
-
MobileNavItem,
|
|
5590
|
-
{
|
|
5591
|
-
onClick: () => {
|
|
5592
|
-
handleTradeNavigation();
|
|
5593
|
-
},
|
|
5594
|
-
children: "Trade"
|
|
5595
|
-
}
|
|
5596
|
-
),
|
|
5597
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
|
|
5598
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
|
|
5599
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPath), children: "Competition" }),
|
|
5600
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLeaderboardPagePath), children: "Leaderboard" }),
|
|
5601
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
|
|
5602
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
|
|
5603
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedApiPath), children: "API" }),
|
|
5604
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => window.open("https://docs.loafmarkets.com/en/", "_blank", "noopener,noreferrer"), children: "Docs" }),
|
|
5432
|
+
navItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavItem(item), children: item.label }, item.key)),
|
|
5605
5433
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderTop: "1px solid #2b3139", margin: "8px 0" } }),
|
|
5606
5434
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5607
5435
|
MobileNavItem,
|
|
@@ -14993,6 +14821,7 @@ function PortfolioActivityPanel({
|
|
|
14993
14821
|
showPositionsTab = false,
|
|
14994
14822
|
showSubscriptionsTab = true,
|
|
14995
14823
|
onPositionClick,
|
|
14824
|
+
onSharePosition,
|
|
14996
14825
|
onAssetClick,
|
|
14997
14826
|
onClosePosition,
|
|
14998
14827
|
offeringOrders = [],
|
|
@@ -15284,17 +15113,23 @@ function PortfolioActivityPanel({
|
|
|
15284
15113
|
] }),
|
|
15285
15114
|
/* @__PURE__ */ jsxRuntime.jsxs(CPnlCell, { children: [
|
|
15286
15115
|
/* @__PURE__ */ jsxRuntime.jsx(CCellLabel, { children: "PNL (%)" }),
|
|
15287
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15288
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15289
|
-
|
|
15290
|
-
|
|
15116
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
|
|
15117
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CPnlLine, { children: [
|
|
15118
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CPnlValue, { $positive: isPositive, children: [
|
|
15119
|
+
isPositive ? "+" : "-",
|
|
15120
|
+
formatCurrency4(Math.abs(pnl))
|
|
15121
|
+
] }),
|
|
15122
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CPnlPct, { $positive: isPositive, children: [
|
|
15123
|
+
"(",
|
|
15124
|
+
isPositive ? "+" : "",
|
|
15125
|
+
pnlPercent.toFixed(1),
|
|
15126
|
+
"%)"
|
|
15127
|
+
] })
|
|
15291
15128
|
] }),
|
|
15292
|
-
/* @__PURE__ */ jsxRuntime.
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
"%)"
|
|
15297
|
-
] })
|
|
15129
|
+
onSharePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
|
|
15130
|
+
e.stopPropagation();
|
|
15131
|
+
onSharePosition(pos);
|
|
15132
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(ShareIcon, {}) })
|
|
15298
15133
|
] })
|
|
15299
15134
|
] }),
|
|
15300
15135
|
/* @__PURE__ */ jsxRuntime.jsx(CChevronWrap, { $open: posExpanded, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.5)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "6 9 12 15 18 9" }) }) })
|
|
@@ -15314,16 +15149,16 @@ function PortfolioActivityPanel({
|
|
|
15314
15149
|
/* @__PURE__ */ jsxRuntime.jsx(CDValue, { children: formatCurrency4(pos.marketPrice) })
|
|
15315
15150
|
] })
|
|
15316
15151
|
] }),
|
|
15317
|
-
onClosePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CActionRow, { children: [
|
|
15318
|
-
/* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
|
|
15319
|
-
/* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
|
|
15152
|
+
(onClosePosition || onSharePosition) && !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CActionRow, { children: [
|
|
15153
|
+
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
|
|
15154
|
+
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
|
|
15320
15155
|
] })
|
|
15321
15156
|
] })
|
|
15322
15157
|
] }, pos.tokenName);
|
|
15323
15158
|
})
|
|
15324
15159
|
] }),
|
|
15325
15160
|
positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15326
|
-
/* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: !!onClosePosition, children: [
|
|
15161
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PositionsHeader, { $hasClose: !!(onClosePosition || onSharePosition), children: [
|
|
15327
15162
|
/* @__PURE__ */ jsxRuntime.jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
|
|
15328
15163
|
"Asset ",
|
|
15329
15164
|
posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
|
|
@@ -15356,7 +15191,7 @@ function PortfolioActivityPanel({
|
|
|
15356
15191
|
const pnl = pos.propertyPnl ?? currentValue - costBasis;
|
|
15357
15192
|
const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
|
|
15358
15193
|
const isPositive = pnl >= 0;
|
|
15359
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
|
|
15194
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PositionsRow, { $hasClose: !!(onClosePosition || onSharePosition), children: [
|
|
15360
15195
|
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
15361
15196
|
/* @__PURE__ */ jsxRuntime.jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }),
|
|
15362
15197
|
pos.settling && /* @__PURE__ */ jsxRuntime.jsx(SettlingTip, { children: /* @__PURE__ */ jsxRuntime.jsx(SettlingSpinner, {}) })
|
|
@@ -15373,23 +15208,29 @@ function PortfolioActivityPanel({
|
|
|
15373
15208
|
] }) }),
|
|
15374
15209
|
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency4(pos.averageEntryPrice) }) }),
|
|
15375
15210
|
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency4(pos.marketPrice) }) }),
|
|
15376
|
-
/* @__PURE__ */ jsxRuntime.
|
|
15377
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
15378
|
-
|
|
15379
|
-
|
|
15211
|
+
/* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "0.4rem" }, children: [
|
|
15212
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
15213
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PnLAmount, { $positive: isPositive, children: [
|
|
15214
|
+
isPositive ? "+" : "-",
|
|
15215
|
+
formatCurrency4(Math.abs(pnl))
|
|
15216
|
+
] }),
|
|
15217
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PnLPercentage, { $positive: isPositive, children: [
|
|
15218
|
+
isPositive ? "+" : "",
|
|
15219
|
+
pnlPercent.toFixed(1),
|
|
15220
|
+
"%"
|
|
15221
|
+
] })
|
|
15380
15222
|
] }),
|
|
15381
|
-
/* @__PURE__ */ jsxRuntime.
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
/* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
|
|
15223
|
+
onSharePosition && !pos.settling && /* @__PURE__ */ jsxRuntime.jsx(CShareIconBtn, { role: "button", "aria-label": "Share position", onClick: (e) => {
|
|
15224
|
+
e.stopPropagation();
|
|
15225
|
+
onSharePosition(pos);
|
|
15226
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(ShareIcon, {}) })
|
|
15227
|
+
] }) }),
|
|
15228
|
+
(onClosePosition || onSharePosition) && /* @__PURE__ */ jsxRuntime.jsx(PositionsCell, { children: !pos.settling && /* @__PURE__ */ jsxRuntime.jsxs(CloseActions, { children: [
|
|
15229
|
+
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
|
|
15389
15230
|
e.stopPropagation();
|
|
15390
15231
|
onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice);
|
|
15391
15232
|
}, children: "Market Sell" }),
|
|
15392
|
-
/* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
|
|
15233
|
+
onClosePosition && /* @__PURE__ */ jsxRuntime.jsx(CloseBtn, { onClick: (e) => {
|
|
15393
15234
|
e.stopPropagation();
|
|
15394
15235
|
onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice);
|
|
15395
15236
|
}, children: "Limit Sell" })
|
|
@@ -16280,6 +16121,29 @@ var CloseBtn = styled10__default.default.button`
|
|
|
16280
16121
|
border-color: rgba(230, 200, 126, 0.5);
|
|
16281
16122
|
}
|
|
16282
16123
|
`;
|
|
16124
|
+
var CShareIconBtn = styled10__default.default.span`
|
|
16125
|
+
display: inline-flex;
|
|
16126
|
+
align-items: center;
|
|
16127
|
+
justify-content: center;
|
|
16128
|
+
width: 26px;
|
|
16129
|
+
height: 26px;
|
|
16130
|
+
border-radius: 6px;
|
|
16131
|
+
color: #E6C87E;
|
|
16132
|
+
cursor: pointer;
|
|
16133
|
+
pointer-events: auto;
|
|
16134
|
+
transition: color 0.15s ease, background 0.15s ease;
|
|
16135
|
+
&:hover {
|
|
16136
|
+
color: #F2D898;
|
|
16137
|
+
background: rgba(230, 200, 126, 0.14);
|
|
16138
|
+
}
|
|
16139
|
+
&:active { background: rgba(230, 200, 126, 0.22); }
|
|
16140
|
+
svg { width: 15px; height: 15px; }
|
|
16141
|
+
`;
|
|
16142
|
+
var ShareIcon = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
16143
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12v7a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7" }),
|
|
16144
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 6 12 2 8 6" }),
|
|
16145
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "2", x2: "12", y2: "15" })
|
|
16146
|
+
] });
|
|
16283
16147
|
var CloseAllHeaderBtn = styled10__default.default.button`
|
|
16284
16148
|
background: rgba(230, 200, 126, 0.1);
|
|
16285
16149
|
border: 1px solid rgba(230, 200, 126, 0.3);
|