@loafmarkets/ui 0.1.358 → 0.1.360

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
@@ -584,6 +584,8 @@ type LoginPopupProps = {
584
584
  walletAddress?: string | null;
585
585
  /** Called when the user submits a referral code during onboarding. */
586
586
  onSubmitReferralCode?: (code: string) => Promise<void> | void;
587
+ /** Called when the user skips the referral code and joins the waitlist. Receives their signup email. Resolves to a success message. */
588
+ onJoinWaitlist?: (email: string) => Promise<string> | void;
587
589
  /** Handler invoked when the user selects "Sign in with Wallet". */
588
590
  onWalletLogin?: () => Promise<void> | void;
589
591
  /** Handler invoked when the user selects "Sign in with Passkey". When omitted, the button is hidden. */
package/dist/index.d.ts CHANGED
@@ -584,6 +584,8 @@ type LoginPopupProps = {
584
584
  walletAddress?: string | null;
585
585
  /** Called when the user submits a referral code during onboarding. */
586
586
  onSubmitReferralCode?: (code: string) => Promise<void> | void;
587
+ /** Called when the user skips the referral code and joins the waitlist. Receives their signup email. Resolves to a success message. */
588
+ onJoinWaitlist?: (email: string) => Promise<string> | void;
587
589
  /** Handler invoked when the user selects "Sign in with Wallet". */
588
590
  onWalletLogin?: () => Promise<void> | void;
589
591
  /** Handler invoked when the user selects "Sign in with Passkey". When omitted, the button is hidden. */
package/dist/index.js CHANGED
@@ -4591,9 +4591,14 @@ var PriceChart = React5__namespace.forwardRef(
4591
4591
  }
4592
4592
  );
4593
4593
  PriceChart.displayName = "PriceChart";
4594
- var formatPrice3 = (value, currencySymbol) => {
4594
+ var formatPrice3 = (value, currencySymbol, compact) => {
4595
4595
  const abs = Math.abs(value);
4596
4596
  if (abs >= 1e6) {
4597
+ if (!compact) {
4598
+ return `${currencySymbol}${Math.round(value).toLocaleString(void 0, {
4599
+ maximumFractionDigits: 0
4600
+ })}`;
4601
+ }
4597
4602
  const unit = abs >= 1e12 ? { v: 1e12, s: "T" } : abs >= 1e9 ? { v: 1e9, s: "B" } : { v: 1e6, s: "M" };
4598
4603
  return `${currencySymbol}${(value / unit.v).toFixed(1)}${unit.s}`;
4599
4604
  }
@@ -4636,6 +4641,14 @@ var PropertyHeroHeader = React5__namespace.forwardRef(
4636
4641
  const tradeHoverColor = "#f5dd9a";
4637
4642
  const [isTradeInteracting, setIsTradeInteracting] = React5__namespace.useState(false);
4638
4643
  const [isOfferInteracting, setIsOfferInteracting] = React5__namespace.useState(false);
4644
+ const [isMobile, setIsMobile] = React5__namespace.useState(
4645
+ () => typeof window !== "undefined" && window.innerWidth <= 768
4646
+ );
4647
+ React5__namespace.useEffect(() => {
4648
+ const onResize = () => setIsMobile(window.innerWidth <= 768);
4649
+ window.addEventListener("resize", onResize);
4650
+ return () => window.removeEventListener("resize", onResize);
4651
+ }, []);
4639
4652
  const isTradeDisabled = !onTrade;
4640
4653
  const isMakeOfferButtonDisabled = makeOfferDisabled || !onMakeOffer;
4641
4654
  const showMakeOfferButton = !hideMakeOfferButton;
@@ -4683,7 +4696,7 @@ var PropertyHeroHeader = React5__namespace.forwardRef(
4683
4696
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { width: 110, height: 24 }) : price == null ? null : /* @__PURE__ */ jsxRuntime.jsxs(PriceRow, { children: [
4684
4697
  /* @__PURE__ */ jsxRuntime.jsx(CurrencyLabel, { children: "USD" }),
4685
4698
  changePercent != null ? /* @__PURE__ */ jsxRuntime.jsx(PriceArrow, { $isPositive: isPositive, children: isPositive ? "\u25B2" : "\u25BC" }) : null,
4686
- formatPrice3(price, "")
4699
+ formatPrice3(price, "", isMobile)
4687
4700
  ] }),
4688
4701
  changePercent != null ? /* @__PURE__ */ jsxRuntime.jsxs(PriceChangeRow, { $isPositive: isPositive, children: [
4689
4702
  priceChange != null ? `${isPositive ? "+" : ""}${priceChange.toFixed(2)} ` : null,
@@ -6465,7 +6478,8 @@ var LoginPopup = ({
6465
6478
  initialView,
6466
6479
  kycStatus: kycStatusProp,
6467
6480
  walletAddress,
6468
- onSubmitReferralCode
6481
+ onSubmitReferralCode,
6482
+ onJoinWaitlist
6469
6483
  }) => {
6470
6484
  const [view, setView] = React5.useState(() => initialView ?? "main");
6471
6485
  const [email, setEmail] = React5.useState("");
@@ -6476,6 +6490,8 @@ var LoginPopup = ({
6476
6490
  const [referralCode, setReferralCode] = React5.useState("");
6477
6491
  const [referralLoading, setReferralLoading] = React5.useState(false);
6478
6492
  const [referralError, setReferralError] = React5.useState("");
6493
+ const [waitlistLoading, setWaitlistLoading] = React5.useState(false);
6494
+ const [waitlistMessage, setWaitlistMessage] = React5.useState("");
6479
6495
  const [loading, setLoading] = React5.useState(false);
6480
6496
  const [isSignUp, setIsSignUp] = React5.useState(false);
6481
6497
  const [fundingAmount] = React5.useState("");
@@ -7104,6 +7120,22 @@ var LoginPopup = ({
7104
7120
  setReferralLoading(false);
7105
7121
  }
7106
7122
  };
7123
+ const handleJoinWaitlistSkip = async () => {
7124
+ if (!onJoinWaitlist) {
7125
+ onClose();
7126
+ return;
7127
+ }
7128
+ setReferralError("");
7129
+ setWaitlistLoading(true);
7130
+ try {
7131
+ const message = await onJoinWaitlist(email);
7132
+ setWaitlistMessage(message || "You're on the waitlist.");
7133
+ setTimeout(() => onClose(), 1400);
7134
+ } catch (err) {
7135
+ setReferralError(err instanceof Error ? err.message : "Couldn't join the waitlist. Please try again.");
7136
+ setWaitlistLoading(false);
7137
+ }
7138
+ };
7107
7139
  return /* @__PURE__ */ jsxRuntime.jsx(Overlay2, { onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(PopupContainer, { onClick: (event) => event.stopPropagation(), children: [
7108
7140
  /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: onClose, "aria-label": "Close login popup", 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.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" }) }) }),
7109
7141
  /* @__PURE__ */ jsxRuntime.jsxs(OnboardingStepContainer, { children: [
@@ -7123,7 +7155,7 @@ var LoginPopup = ({
7123
7155
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }),
7124
7156
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })
7125
7157
  ] }) }),
7126
- /* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "Do you have a referral code?" }),
7158
+ /* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "Enter code to access Private Beta trading" }),
7127
7159
  /* @__PURE__ */ jsxRuntime.jsx(OnboardingSubtext, { style: { marginBottom: "1.5rem" }, children: "Enter your code to unlock $100k in testnet USD, or skip to continue." }),
7128
7160
  /* @__PURE__ */ jsxRuntime.jsxs(EmailFormContainer, { style: { width: "100%", marginBottom: 0 }, children: [
7129
7161
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -7153,13 +7185,17 @@ var LoginPopup = ({
7153
7185
  ),
7154
7186
  referralError && /* @__PURE__ */ jsxRuntime.jsx(StatusMessage, { $error: true, children: referralError })
7155
7187
  ] }),
7156
- /* @__PURE__ */ jsxRuntime.jsx(
7188
+ waitlistMessage ? /* @__PURE__ */ jsxRuntime.jsxs(StatusMessage, { style: { marginTop: "0.75rem" }, children: [
7189
+ "\u2713 ",
7190
+ waitlistMessage
7191
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
7157
7192
  OnboardingSkipButton,
7158
7193
  {
7159
7194
  type: "button",
7160
- onClick: onClose,
7195
+ onClick: () => void handleJoinWaitlistSkip(),
7196
+ disabled: waitlistLoading,
7161
7197
  style: { marginTop: "0.75rem" },
7162
- children: "Skip for now"
7198
+ children: waitlistLoading ? "Joining\u2026" : "Skip for now & join Waitlist"
7163
7199
  }
7164
7200
  )
7165
7201
  ] })
@@ -9150,7 +9186,7 @@ function PropertyOverview({
9150
9186
  videoUrl,
9151
9187
  tokenName,
9152
9188
  onPhotoClick: onPhotosClick,
9153
- hideMap: true
9189
+ hideSuburb: true
9154
9190
  }
9155
9191
  ),
9156
9192
  /* @__PURE__ */ jsxRuntime.jsx(FeaturesPanel, { children: features.map((item, i) => /* @__PURE__ */ jsxRuntime.jsxs(AssetFeatureItem, { children: [