@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.d.mts CHANGED
@@ -503,7 +503,6 @@ type HeaderProps = {
503
503
  onLogout?: () => Promise<void> | void;
504
504
  onSignInClick?: () => void;
505
505
  loginPopupComponent?: React__default.ComponentType<HeaderLoginPopupComponentProps>;
506
- tradeUrl?: string;
507
506
  tradePath?: string;
508
507
  homePath?: string;
509
508
  aboutPath?: string;
package/dist/index.d.ts CHANGED
@@ -503,7 +503,6 @@ type HeaderProps = {
503
503
  onLogout?: () => Promise<void> | void;
504
504
  onSignInClick?: () => void;
505
505
  loginPopupComponent?: React__default.ComponentType<HeaderLoginPopupComponentProps>;
506
- tradeUrl?: string;
507
506
  tradePath?: string;
508
507
  homePath?: string;
509
508
  aboutPath?: string;
package/dist/index.js CHANGED
@@ -4437,16 +4437,13 @@ var PriceBlock = styled23__default.default.span`
4437
4437
  border-left: 1px solid rgba(255, 255, 255, 0.25);
4438
4438
  min-height: 1.5rem;
4439
4439
  `;
4440
- var DEFAULT_TRADE_URL = "https://loafx-frontend-web.vercel.app/";
4441
4440
  var DEFAULT_TRADE_PATH = "/trade";
4442
4441
  var DEFAULT_HOME_PATH = "/";
4443
4442
  var DEFAULT_ABOUT_PATH = "/about";
4444
4443
  var DEFAULT_LEARN_PATH = "/learn";
4445
- var DEFAULT_OFFERINGS_PATH = "/ipo/musgrave";
4446
4444
  var DEFAULT_PROPERTY_MAP_PATH = "/map";
4447
4445
  var DEFAULT_PORTFOLIO_PATH = "/portfolio";
4448
4446
  var DEFAULT_LOAF_LIQUIDITY_PATH = "/loaf-liquidity";
4449
- var DEFAULT_AUTH_LOGIN_URL = "http://localhost:5174/";
4450
4447
  var DEFAULT_AUTH_RETURN_PARAM = "returnTo";
4451
4448
  var LOGIN_POPUP_EVENT = "loaf:open-login-popup";
4452
4449
  var Header = ({
@@ -4458,16 +4455,15 @@ var Header = ({
4458
4455
  onLogout,
4459
4456
  onSignInClick,
4460
4457
  loginPopupComponent: LoginPopupComponent,
4461
- tradeUrl = DEFAULT_TRADE_URL,
4462
4458
  tradePath = DEFAULT_TRADE_PATH,
4463
4459
  homePath = DEFAULT_HOME_PATH,
4464
4460
  aboutPath = DEFAULT_ABOUT_PATH,
4465
4461
  learnPath = DEFAULT_LEARN_PATH,
4466
- offeringsPath = DEFAULT_OFFERINGS_PATH,
4462
+ offeringsPath,
4467
4463
  propertyMapPath = DEFAULT_PROPERTY_MAP_PATH,
4468
4464
  portfolioPath = DEFAULT_PORTFOLIO_PATH,
4469
4465
  loafLiquidityPath = DEFAULT_LOAF_LIQUIDITY_PATH,
4470
- authLoginUrl = DEFAULT_AUTH_LOGIN_URL,
4466
+ authLoginUrl,
4471
4467
  authReturnParam = DEFAULT_AUTH_RETURN_PARAM,
4472
4468
  getAuthReturnUrl,
4473
4469
  logoHref,
@@ -4563,7 +4559,7 @@ var Header = ({
4563
4559
  onLoafLiquidityClick();
4564
4560
  return;
4565
4561
  }
4566
- performNavigation(loafLiquidityPath);
4562
+ performNavigation(resolvedLoafLiquidityPath);
4567
4563
  };
4568
4564
  const handleTradeNavigation = () => {
4569
4565
  closeMenus();
@@ -4571,9 +4567,7 @@ var Header = ({
4571
4567
  onTradeClick();
4572
4568
  return;
4573
4569
  }
4574
- if (typeof window !== "undefined") {
4575
- window.location.href = tradeUrl;
4576
- }
4570
+ performNavigation(resolvedTradePath);
4577
4571
  };
4578
4572
  const handleLogoutClick = async (event) => {
4579
4573
  event?.preventDefault();
@@ -4653,14 +4647,23 @@ var Header = ({
4653
4647
  setShowLoginPopup(false);
4654
4648
  setLoginPopupInitialView(void 0);
4655
4649
  }, []);
4650
+ const resolvedTradePath = tradePath ?? DEFAULT_TRADE_PATH;
4651
+ const resolvedHomePath = homePath ?? DEFAULT_HOME_PATH;
4652
+ const resolvedAboutPath = aboutPath ?? DEFAULT_ABOUT_PATH;
4653
+ const resolvedLearnPath = learnPath ?? DEFAULT_LEARN_PATH;
4654
+ const resolvedOfferingsPath = offeringsPath ?? void 0;
4655
+ const offeringsHref = resolvedOfferingsPath ?? resolvedHomePath;
4656
+ const resolvedPropertyMapPath = propertyMapPath ?? DEFAULT_PROPERTY_MAP_PATH;
4657
+ const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
4658
+ const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
4656
4659
  const inferredActiveTab = (() => {
4657
- if (locationPath === tradePath) return "trade";
4658
- if (locationPath === homePath) return "home";
4659
- if (locationPath === aboutPath) return "about";
4660
- if (locationPath === learnPath) return "learn";
4661
- if (locationPath.startsWith(offeringsPath)) return "offerings";
4662
- if (locationPath === propertyMapPath) return "propertyMap";
4663
- if (locationPath === portfolioPath) return "portfolio";
4660
+ if (locationPath === resolvedTradePath) return "trade";
4661
+ if (locationPath === resolvedHomePath) return "home";
4662
+ if (locationPath === resolvedAboutPath) return "about";
4663
+ if (locationPath === resolvedLearnPath) return "learn";
4664
+ if (resolvedOfferingsPath && locationPath.startsWith(resolvedOfferingsPath)) return "offerings";
4665
+ if (locationPath === resolvedPropertyMapPath) return "propertyMap";
4666
+ if (locationPath === resolvedPortfolioPath) return "portfolio";
4664
4667
  return null;
4665
4668
  })();
4666
4669
  const resolvedActiveTab = activeTab ?? inferredActiveTab;
@@ -4676,7 +4679,7 @@ var Header = ({
4676
4679
  /* @__PURE__ */ jsxRuntime.jsxs(HeaderContainer, { children: [
4677
4680
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
4678
4681
  /* @__PURE__ */ jsxRuntime.jsxs(Logo, { children: [
4679
- /* @__PURE__ */ jsxRuntime.jsx(LogoLink, { href: logoHref ?? homePath, onClick: handleLogoNavigation, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: Loaf_logo_Banner_default, alt: "LOAF Logo" }) }),
4682
+ /* @__PURE__ */ jsxRuntime.jsx(LogoLink, { href: logoHref ?? resolvedHomePath, onClick: handleLogoNavigation, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: Loaf_logo_Banner_default, alt: "LOAF Logo" }) }),
4680
4683
  /* @__PURE__ */ jsxRuntime.jsx("h1", { children: "LOAF" })
4681
4684
  ] }),
4682
4685
  /* @__PURE__ */ jsxRuntime.jsxs(Nav, { $isOpen: isMobileMenuOpen, className: "mobile-menu", children: [
@@ -4689,11 +4692,11 @@ var Header = ({
4689
4692
  /* @__PURE__ */ jsxRuntime.jsx(
4690
4693
  NavLink,
4691
4694
  {
4692
- href: homePath,
4695
+ href: resolvedHomePath,
4693
4696
  className: homeActive ? "active" : "",
4694
4697
  onClick: (event) => {
4695
4698
  event.preventDefault();
4696
- handleNavigation(homePath);
4699
+ handleNavigation(resolvedHomePath);
4697
4700
  },
4698
4701
  children: "Home"
4699
4702
  }
@@ -4701,7 +4704,7 @@ var Header = ({
4701
4704
  /* @__PURE__ */ jsxRuntime.jsx(
4702
4705
  NavLink,
4703
4706
  {
4704
- href: tradeUrl,
4707
+ href: resolvedTradePath,
4705
4708
  className: tradeActive ? "active" : "",
4706
4709
  onClick: (event) => {
4707
4710
  event.preventDefault();
@@ -4713,11 +4716,11 @@ var Header = ({
4713
4716
  /* @__PURE__ */ jsxRuntime.jsx(
4714
4717
  NavLink,
4715
4718
  {
4716
- href: portfolioPath,
4719
+ href: resolvedPortfolioPath,
4717
4720
  className: portfolioActive ? "active" : "",
4718
4721
  onClick: (event) => {
4719
4722
  event.preventDefault();
4720
- handleNavigation(portfolioPath);
4723
+ handleNavigation(resolvedPortfolioPath);
4721
4724
  },
4722
4725
  children: "Portfolio"
4723
4726
  }
@@ -4725,11 +4728,11 @@ var Header = ({
4725
4728
  /* @__PURE__ */ jsxRuntime.jsx(
4726
4729
  NavLink,
4727
4730
  {
4728
- href: offeringsPath,
4731
+ href: offeringsHref,
4729
4732
  className: offeringsActive ? "active" : "",
4730
4733
  onClick: (event) => {
4731
4734
  event.preventDefault();
4732
- handleNavigation(offeringsPath);
4735
+ handleNavigation(offeringsHref);
4733
4736
  },
4734
4737
  children: "Initial Offerings"
4735
4738
  }
@@ -4737,11 +4740,11 @@ var Header = ({
4737
4740
  /* @__PURE__ */ jsxRuntime.jsx(
4738
4741
  NavLink,
4739
4742
  {
4740
- href: propertyMapPath,
4743
+ href: resolvedPropertyMapPath,
4741
4744
  className: propertyMapActive ? "active" : "",
4742
4745
  onClick: (event) => {
4743
4746
  event.preventDefault();
4744
- handleNavigation(propertyMapPath);
4747
+ handleNavigation(resolvedPropertyMapPath);
4745
4748
  },
4746
4749
  children: "Property Map"
4747
4750
  }
@@ -4749,11 +4752,11 @@ var Header = ({
4749
4752
  /* @__PURE__ */ jsxRuntime.jsx(
4750
4753
  NavLink,
4751
4754
  {
4752
- href: learnPath,
4755
+ href: resolvedLearnPath,
4753
4756
  className: learnActive ? "active" : "",
4754
4757
  onClick: (event) => {
4755
4758
  event.preventDefault();
4756
- handleNavigation(learnPath);
4759
+ handleNavigation(resolvedLearnPath);
4757
4760
  },
4758
4761
  children: "Learn"
4759
4762
  }
@@ -4761,11 +4764,11 @@ var Header = ({
4761
4764
  /* @__PURE__ */ jsxRuntime.jsx(
4762
4765
  NavLink,
4763
4766
  {
4764
- href: aboutPath,
4767
+ href: resolvedAboutPath,
4765
4768
  className: aboutActive ? "active" : "",
4766
4769
  onClick: (event) => {
4767
4770
  event.preventDefault();
4768
- handleNavigation(aboutPath);
4771
+ handleNavigation(resolvedAboutPath);
4769
4772
  },
4770
4773
  children: "About"
4771
4774
  }
@@ -4795,7 +4798,7 @@ var Header = ({
4795
4798
  /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.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" }) }),
4796
4799
  /* @__PURE__ */ jsxRuntime.jsx("input", { type: "text", placeholder: "Search..." })
4797
4800
  ] }),
4798
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(homePath), children: "Home" }),
4801
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedHomePath), children: "Home" }),
4799
4802
  /* @__PURE__ */ jsxRuntime.jsx(
4800
4803
  MobileNavItem,
4801
4804
  {
@@ -4805,11 +4808,11 @@ var Header = ({
4805
4808
  children: "Trade"
4806
4809
  }
4807
4810
  ),
4808
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(portfolioPath), children: "Portfolio" }),
4809
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsPath), children: "Initial Offerings" }),
4810
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(propertyMapPath), children: "Property Map" }),
4811
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(learnPath), children: "Learn" }),
4812
- /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(aboutPath), children: "About" }),
4811
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPortfolioPath), children: "Portfolio" }),
4812
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
4813
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
4814
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
4815
+ /* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedAboutPath), children: "About" }),
4813
4816
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderTop: "1px solid #2b3139", margin: "8px 0" } }),
4814
4817
  /* @__PURE__ */ jsxRuntime.jsx(
4815
4818
  MobileNavItem,