@loafmarkets/ui 0.1.17 → 0.1.18

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.mjs CHANGED
@@ -4412,16 +4412,13 @@ var PriceBlock = styled23.span`
4412
4412
  border-left: 1px solid rgba(255, 255, 255, 0.25);
4413
4413
  min-height: 1.5rem;
4414
4414
  `;
4415
- var DEFAULT_TRADE_URL = "https://loafx-frontend-web.vercel.app/";
4416
4415
  var DEFAULT_TRADE_PATH = "/trade";
4417
4416
  var DEFAULT_HOME_PATH = "/";
4418
4417
  var DEFAULT_ABOUT_PATH = "/about";
4419
4418
  var DEFAULT_LEARN_PATH = "/learn";
4420
- var DEFAULT_OFFERINGS_PATH = "/ipo/musgrave";
4421
4419
  var DEFAULT_PROPERTY_MAP_PATH = "/map";
4422
4420
  var DEFAULT_PORTFOLIO_PATH = "/portfolio";
4423
4421
  var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
4424
- var DEFAULT_AUTH_LOGIN_URL = "http://localhost:5174/";
4425
4422
  var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
4426
4423
  var LOGIN_POPUP_EVENT = "loaf:open-login-popup";
4427
4424
  var Header = ({
@@ -4433,16 +4430,15 @@ var Header = ({
4433
4430
  onLogout,
4434
4431
  onSignInClick,
4435
4432
  loginPopupComponent: LoginPopupComponent,
4436
- tradeUrl = DEFAULT_TRADE_URL,
4437
4433
  tradePath = DEFAULT_TRADE_PATH,
4438
4434
  homePath = DEFAULT_HOME_PATH,
4439
4435
  aboutPath = DEFAULT_ABOUT_PATH,
4440
4436
  learnPath = DEFAULT_LEARN_PATH,
4441
- offeringsPath = DEFAULT_OFFERINGS_PATH,
4437
+ offeringsPath,
4442
4438
  propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
4443
4439
  portfolioPath = DEFAULT_PORTFOLIO_PATH,
4444
4440
  loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
4445
- authLoginUrl = DEFAULT_AUTH_LOGIN_URL,
4441
+ authLoginUrl,
4446
4442
  authReturnParam = DEFAULT_AUTH_RETURN_PARAM,
4447
4443
  getAuthReturnUrl,
4448
4444
  logoHref,
@@ -4538,7 +4534,7 @@ var Header = ({
4538
4534
  onLoafLiquidityClick();
4539
4535
  return;
4540
4536
  }
4541
- performNavigation(loafLiquidityPath);
4537
+ performNavigation(resolvedLoafLiquidityPath);
4542
4538
  };
4543
4539
  const handleTradeNavigation = () => {
4544
4540
  closeMenus();
@@ -4546,9 +4542,7 @@ var Header = ({
4546
4542
  onTradeClick();
4547
4543
  return;
4548
4544
  }
4549
- if (typeof window !== "undefined") {
4550
- window.location.href = tradeUrl;
4551
- }
4545
+ performNavigation(resolvedTradePath);
4552
4546
  };
4553
4547
  const handleLogoutClick = async (event) => {
4554
4548
  event?.preventDefault();
@@ -4628,14 +4622,23 @@ var Header = ({
4628
4622
  setShowLoginPopup(false);
4629
4623
  setLoginPopupInitialView(void 0);
4630
4624
  }, []);
4625
+ const resolvedTradePath = tradePath ?? DEFAULT_TRADE_PATH;
4626
+ const resolvedHomePath = homePath ?? DEFAULT_HOME_PATH;
4627
+ const resolvedAboutPath = aboutPath ?? DEFAULT_ABOUT_PATH;
4628
+ const resolvedLearnPath = learnPath ?? DEFAULT_LEARN_PATH;
4629
+ const resolvedOfferingsPath = offeringsPath ?? void 0;
4630
+ const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
4631
+ const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
4632
+ const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
4633
+ const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
4631
4634
  const inferredActiveTab = (() => {
4632
- if (locationPath === tradePath) return "trade";
4633
- if (locationPath === homePath) return "home";
4634
- if (locationPath === aboutPath) return "about";
4635
- if (locationPath === learnPath) return "learn";
4636
- if (locationPath.startsWith(offeringsPath)) return "offerings";
4637
- if (locationPath === propertyMapPath) return "propertyMap";
4638
- if (locationPath === portfolioPath) return "portfolio";
4635
+ if (locationPath === resolvedTradePath) return "trade";
4636
+ if (locationPath === resolvedHomePath) return "home";
4637
+ if (locationPath === resolvedAboutPath) return "about";
4638
+ if (locationPath === resolvedLearnPath) return "learn";
4639
+ if (resolvedOfferingsPath && locationPath.startsWith(resolvedOfferingsPath)) return "offerings";
4640
+ if (locationPath === resolvedPropertyMapPath) return "propertyMap";
4641
+ if (locationPath === resolvedPortfolioPath) return "portfolio";
4639
4642
  return null;
4640
4643
  })();
4641
4644
  const resolvedActiveTab = activeTab ?? inferredActiveTab;
@@ -4651,7 +4654,7 @@ var Header = ({
4651
4654
  /* @__PURE__ */ jsxs(HeaderContainer, { children: [
4652
4655
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
4653
4656
  /* @__PURE__ */ jsxs(Logo, { children: [
4654
- /* @__PURE__ */ jsx(LogoLink, { href: logoHref ?? homePath, onClick: handleLogoNavigation, children: /* @__PURE__ */ jsx("img", { src: Loaf_logo_Banner_default, alt: "LOAF Logo" }) }),
4657
+ /* @__PURE__ */ jsx(LogoLink, { href: logoHref ?? resolvedHomePath, onClick: handleLogoNavigation, children: /* @__PURE__ */ jsx("img", { src: Loaf_logo_Banner_default, alt: "LOAF Logo" }) }),
4655
4658
  /* @__PURE__ */ jsx("h1", { children: "LOAF" })
4656
4659
  ] }),
4657
4660
  /* @__PURE__ */ jsxs(Nav, { $isOpen: isMobileMenuOpen, className: "mobile-menu", children: [
@@ -4664,11 +4667,11 @@ var Header = ({
4664
4667
  /* @__PURE__ */ jsx(
4665
4668
  NavLink,
4666
4669
  {
4667
- href: homePath,
4670
+ href: resolvedHomePath,
4668
4671
  className: homeActive ? "active" : "",
4669
4672
  onClick: (event) => {
4670
4673
  event.preventDefault();
4671
- handleNavigation(homePath);
4674
+ handleNavigation(resolvedHomePath);
4672
4675
  },
4673
4676
  children: "Home"
4674
4677
  }
@@ -4676,7 +4679,7 @@ var Header = ({
4676
4679
  /* @__PURE__ */ jsx(
4677
4680
  NavLink,
4678
4681
  {
4679
- href: tradeUrl,
4682
+ href: resolvedTradePath,
4680
4683
  className: tradeActive ? "active" : "",
4681
4684
  onClick: (event) => {
4682
4685
  event.preventDefault();
@@ -4688,11 +4691,11 @@ var Header = ({
4688
4691
  /* @__PURE__ */ jsx(
4689
4692
  NavLink,
4690
4693
  {
4691
- href: portfolioPath,
4694
+ href: resolvedPortfolioPath,
4692
4695
  className: portfolioActive ? "active" : "",
4693
4696
  onClick: (event) => {
4694
4697
  event.preventDefault();
4695
- handleNavigation(portfolioPath);
4698
+ handleNavigation(resolvedPortfolioPath);
4696
4699
  },
4697
4700
  children: "Portfolio"
4698
4701
  }
@@ -4700,11 +4703,11 @@ var Header = ({
4700
4703
  /* @__PURE__ */ jsx(
4701
4704
  NavLink,
4702
4705
  {
4703
- href: offeringsPath,
4706
+ href: offeringsHref,
4704
4707
  className: offeringsActive ? "active" : "",
4705
4708
  onClick: (event) => {
4706
4709
  event.preventDefault();
4707
- handleNavigation(offeringsPath);
4710
+ handleNavigation(offeringsHref);
4708
4711
  },
4709
4712
  children: "Initial Offerings"
4710
4713
  }
@@ -4712,11 +4715,11 @@ var Header = ({
4712
4715
  /* @__PURE__ */ jsx(
4713
4716
  NavLink,
4714
4717
  {
4715
- href: propertyMapPath,
4718
+ href: resolvedPropertyMapPath,
4716
4719
  className: propertyMapActive ? "active" : "",
4717
4720
  onClick: (event) => {
4718
4721
  event.preventDefault();
4719
- handleNavigation(propertyMapPath);
4722
+ handleNavigation(resolvedPropertyMapPath);
4720
4723
  },
4721
4724
  children: "Property Map"
4722
4725
  }
@@ -4724,11 +4727,11 @@ var Header = ({
4724
4727
  /* @__PURE__ */ jsx(
4725
4728
  NavLink,
4726
4729
  {
4727
- href: learnPath,
4730
+ href: resolvedLearnPath,
4728
4731
  className: learnActive ? "active" : "",
4729
4732
  onClick: (event) => {
4730
4733
  event.preventDefault();
4731
- handleNavigation(learnPath);
4734
+ handleNavigation(resolvedLearnPath);
4732
4735
  },
4733
4736
  children: "Learn"
4734
4737
  }
@@ -4736,11 +4739,11 @@ var Header = ({
4736
4739
  /* @__PURE__ */ jsx(
4737
4740
  NavLink,
4738
4741
  {
4739
- href: aboutPath,
4742
+ href: resolvedAboutPath,
4740
4743
  className: aboutActive ? "active" : "",
4741
4744
  onClick: (event) => {
4742
4745
  event.preventDefault();
4743
- handleNavigation(aboutPath);
4746
+ handleNavigation(resolvedAboutPath);
4744
4747
  },
4745
4748
  children: "About"
4746
4749
  }
@@ -4770,7 +4773,7 @@ var Header = ({
4770
4773
  /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zM5 9.5C5 7.01 7.01 5 9.5 5S14 7.01 14 9.5 11.99 14 9.5 14 5 11.99 5 9.5z" }) }),
4771
4774
  /* @__PURE__ */ jsx("input", { type: "text", placeholder: "Search..." })
4772
4775
  ] }),
4773
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(homePath), children: "Home" }),
4776
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedHomePath), children: "Home" }),
4774
4777
  /* @__PURE__ */ jsx(
4775
4778
  MobileNavItem,
4776
4779
  {
@@ -4780,11 +4783,11 @@ var Header = ({
4780
4783
  children: "Trade"
4781
4784
  }
4782
4785
  ),
4783
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(portfolioPath), children: "Portfolio" }),
4784
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsPath), children: "Initial Offerings" }),
4785
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(propertyMapPath), children: "Property Map" }),
4786
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(learnPath), children: "Learn" }),
4787
- /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(aboutPath), children: "About" }),
4786
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPortfolioPath), children: "Portfolio" }),
4787
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
4788
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
4789
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
4790
+ /* @__PURE__ */ jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
4788
4791
  /* @__PURE__ */ jsx("div", { style: { borderTop: "1px solid #2b3139", margin: "8px 0" } }),
4789
4792
  /* @__PURE__ */ jsx(
4790
4793
  MobileNavItem,