@loafmarkets/ui 0.1.358 → 0.1.359

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
@@ -4565,9 +4565,14 @@ var PriceChart = React5.forwardRef(
4565
4565
  }
4566
4566
  );
4567
4567
  PriceChart.displayName = "PriceChart";
4568
- var formatPrice3 = (value, currencySymbol) => {
4568
+ var formatPrice3 = (value, currencySymbol, compact) => {
4569
4569
  const abs = Math.abs(value);
4570
4570
  if (abs >= 1e6) {
4571
+ if (!compact) {
4572
+ return `${currencySymbol}${Math.round(value).toLocaleString(void 0, {
4573
+ maximumFractionDigits: 0
4574
+ })}`;
4575
+ }
4571
4576
  const unit = abs >= 1e12 ? { v: 1e12, s: "T" } : abs >= 1e9 ? { v: 1e9, s: "B" } : { v: 1e6, s: "M" };
4572
4577
  return `${currencySymbol}${(value / unit.v).toFixed(1)}${unit.s}`;
4573
4578
  }
@@ -4610,6 +4615,14 @@ var PropertyHeroHeader = React5.forwardRef(
4610
4615
  const tradeHoverColor = "#f5dd9a";
4611
4616
  const [isTradeInteracting, setIsTradeInteracting] = React5.useState(false);
4612
4617
  const [isOfferInteracting, setIsOfferInteracting] = React5.useState(false);
4618
+ const [isMobile, setIsMobile] = React5.useState(
4619
+ () => typeof window !== "undefined" && window.innerWidth <= 768
4620
+ );
4621
+ React5.useEffect(() => {
4622
+ const onResize = () => setIsMobile(window.innerWidth <= 768);
4623
+ window.addEventListener("resize", onResize);
4624
+ return () => window.removeEventListener("resize", onResize);
4625
+ }, []);
4613
4626
  const isTradeDisabled = !onTrade;
4614
4627
  const isMakeOfferButtonDisabled = makeOfferDisabled || !onMakeOffer;
4615
4628
  const showMakeOfferButton = !hideMakeOfferButton;
@@ -4657,7 +4670,7 @@ var PropertyHeroHeader = React5.forwardRef(
4657
4670
  isLoading ? /* @__PURE__ */ jsx(Skeleton, { width: 110, height: 24 }) : price == null ? null : /* @__PURE__ */ jsxs(PriceRow, { children: [
4658
4671
  /* @__PURE__ */ jsx(CurrencyLabel, { children: "USD" }),
4659
4672
  changePercent != null ? /* @__PURE__ */ jsx(PriceArrow, { $isPositive: isPositive, children: isPositive ? "\u25B2" : "\u25BC" }) : null,
4660
- formatPrice3(price, "")
4673
+ formatPrice3(price, "", isMobile)
4661
4674
  ] }),
4662
4675
  changePercent != null ? /* @__PURE__ */ jsxs(PriceChangeRow, { $isPositive: isPositive, children: [
4663
4676
  priceChange != null ? `${isPositive ? "+" : ""}${priceChange.toFixed(2)} ` : null,
@@ -6439,7 +6452,8 @@ var LoginPopup = ({
6439
6452
  initialView,
6440
6453
  kycStatus: kycStatusProp,
6441
6454
  walletAddress,
6442
- onSubmitReferralCode
6455
+ onSubmitReferralCode,
6456
+ onJoinWaitlist
6443
6457
  }) => {
6444
6458
  const [view, setView] = useState(() => initialView ?? "main");
6445
6459
  const [email, setEmail] = useState("");
@@ -6450,6 +6464,8 @@ var LoginPopup = ({
6450
6464
  const [referralCode, setReferralCode] = useState("");
6451
6465
  const [referralLoading, setReferralLoading] = useState(false);
6452
6466
  const [referralError, setReferralError] = useState("");
6467
+ const [waitlistLoading, setWaitlistLoading] = useState(false);
6468
+ const [waitlistMessage, setWaitlistMessage] = useState("");
6453
6469
  const [loading, setLoading] = useState(false);
6454
6470
  const [isSignUp, setIsSignUp] = useState(false);
6455
6471
  const [fundingAmount] = useState("");
@@ -7078,6 +7094,22 @@ var LoginPopup = ({
7078
7094
  setReferralLoading(false);
7079
7095
  }
7080
7096
  };
7097
+ const handleJoinWaitlistSkip = async () => {
7098
+ if (!onJoinWaitlist) {
7099
+ onClose();
7100
+ return;
7101
+ }
7102
+ setReferralError("");
7103
+ setWaitlistLoading(true);
7104
+ try {
7105
+ const message = await onJoinWaitlist(email);
7106
+ setWaitlistMessage(message || "You're on the waitlist.");
7107
+ setTimeout(() => onClose(), 1400);
7108
+ } catch (err) {
7109
+ setReferralError(err instanceof Error ? err.message : "Couldn't join the waitlist. Please try again.");
7110
+ setWaitlistLoading(false);
7111
+ }
7112
+ };
7081
7113
  return /* @__PURE__ */ jsx(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsxs(PopupContainer, { onClick: (event) => event.stopPropagation(), children: [
7082
7114
  /* @__PURE__ */ jsx(CloseButton, { onClick: onClose, "aria-label": "Close login popup", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.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" }) }) }),
7083
7115
  /* @__PURE__ */ jsxs(OnboardingStepContainer, { children: [
@@ -7097,7 +7129,7 @@ var LoginPopup = ({
7097
7129
  /* @__PURE__ */ jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
7098
7130
  /* @__PURE__ */ jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
7099
7131
  ] }) }),
7100
- /* @__PURE__ */ jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
7132
+ /* @__PURE__ */ jsx(OnboardingHeading, { children: "Enter code to access Private Beta trading" }),
7101
7133
  /* @__PURE__ */ jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock $100k in testnet USD, or skip to continue." }),
7102
7134
  /* @__PURE__ */ jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
7103
7135
  /* @__PURE__ */ jsx(
@@ -7127,13 +7159,17 @@ var LoginPopup = ({
7127
7159
  ),
7128
7160
  referralError && /* @__PURE__ */ jsx(StatusMessage, { $error: true, children: referralError })
7129
7161
  ] }),
7130
- /* @__PURE__ */ jsx(
7162
+ waitlistMessage ? /* @__PURE__ */ jsxs(StatusMessage, { style: { marginTop: "0.75rem" }, children: [
7163
+ "\u2713 ",
7164
+ waitlistMessage
7165
+ ] }) : /* @__PURE__ */ jsx(
7131
7166
  OnboardingSkipButton,
7132
7167
  {
7133
7168
  type: "button",
7134
- onClick: onClose,
7169
+ onClick: () => void handleJoinWaitlistSkip(),
7170
+ disabled: waitlistLoading,
7135
7171
  style: { marginTop: "0.75rem" },
7136
- children: "Skip for now"
7172
+ children: waitlistLoading ? "Joining\u2026" : "Skip for now & join Waitlist"
7137
7173
  }
7138
7174
  )
7139
7175
  ] })
@@ -9123,8 +9159,7 @@ function PropertyOverview({
9123
9159
  propertyLocation: location,
9124
9160
  videoUrl,
9125
9161
  tokenName,
9126
- onPhotoClick: onPhotosClick,
9127
- hideMap: true
9162
+ onPhotoClick: onPhotosClick
9128
9163
  }
9129
9164
  ),
9130
9165
  /* @__PURE__ */ jsx(FeaturesPanel, { children: features.map((item, i) => /* @__PURE__ */ jsxs(AssetFeatureItem, { children: [