@loafmarkets/ui 0.1.19 → 0.1.21
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 +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +273 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +273 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -438,6 +438,12 @@ type DemoLoginHandler = (email: string, handle?: string | null) => Promise<DemoL
|
|
|
438
438
|
type LoginPopupView = "main" | "email" | "otp" | "kyc" | "kyc-success" | "kyc-failed" | "funding";
|
|
439
439
|
type FundWalletParams = {
|
|
440
440
|
amount: string;
|
|
441
|
+
mode?: "crypto" | "fiat";
|
|
442
|
+
};
|
|
443
|
+
type FundWalletResult = {
|
|
444
|
+
funded: boolean;
|
|
445
|
+
widgetUrl?: string;
|
|
446
|
+
requiresKyc?: boolean;
|
|
441
447
|
};
|
|
442
448
|
type LoginPopupProps = {
|
|
443
449
|
onClose: () => void;
|
|
@@ -479,12 +485,10 @@ type LoginPopupProps = {
|
|
|
479
485
|
passed: boolean;
|
|
480
486
|
}) => void) => React__default.ReactNode;
|
|
481
487
|
/**
|
|
482
|
-
* Handler called when the user clicks "Fund my account". Should open the funding UI (e.g.
|
|
483
|
-
* and resolve with { funded: boolean } when the user exits.
|
|
488
|
+
* Handler called when the user clicks "Fund my account". Should open the funding UI (e.g. Transak onramp)
|
|
489
|
+
* and resolve with { funded: boolean, widgetUrl?: string } when the user exits.
|
|
484
490
|
*/
|
|
485
|
-
onFundWallet?: (params: FundWalletParams) => Promise<
|
|
486
|
-
funded: boolean;
|
|
487
|
-
}> | void;
|
|
491
|
+
onFundWallet?: (params: FundWalletParams) => Promise<FundWalletResult> | void;
|
|
488
492
|
/** Optional view to show immediately when the popup opens. */
|
|
489
493
|
initialView?: LoginPopupView;
|
|
490
494
|
/** Handler invoked when the user selects "Sign in with Wallet". */
|
|
@@ -535,6 +539,7 @@ type HeaderProps = {
|
|
|
535
539
|
onProfileNavigate?: () => void;
|
|
536
540
|
onOrdersNavigate?: () => void;
|
|
537
541
|
onWalletNavigate?: () => void;
|
|
542
|
+
showTradeTab?: boolean;
|
|
538
543
|
};
|
|
539
544
|
declare const Header: React__default.FC<HeaderProps>;
|
|
540
545
|
|
package/dist/index.d.ts
CHANGED
|
@@ -438,6 +438,12 @@ type DemoLoginHandler = (email: string, handle?: string | null) => Promise<DemoL
|
|
|
438
438
|
type LoginPopupView = "main" | "email" | "otp" | "kyc" | "kyc-success" | "kyc-failed" | "funding";
|
|
439
439
|
type FundWalletParams = {
|
|
440
440
|
amount: string;
|
|
441
|
+
mode?: "crypto" | "fiat";
|
|
442
|
+
};
|
|
443
|
+
type FundWalletResult = {
|
|
444
|
+
funded: boolean;
|
|
445
|
+
widgetUrl?: string;
|
|
446
|
+
requiresKyc?: boolean;
|
|
441
447
|
};
|
|
442
448
|
type LoginPopupProps = {
|
|
443
449
|
onClose: () => void;
|
|
@@ -479,12 +485,10 @@ type LoginPopupProps = {
|
|
|
479
485
|
passed: boolean;
|
|
480
486
|
}) => void) => React__default.ReactNode;
|
|
481
487
|
/**
|
|
482
|
-
* Handler called when the user clicks "Fund my account". Should open the funding UI (e.g.
|
|
483
|
-
* and resolve with { funded: boolean } when the user exits.
|
|
488
|
+
* Handler called when the user clicks "Fund my account". Should open the funding UI (e.g. Transak onramp)
|
|
489
|
+
* and resolve with { funded: boolean, widgetUrl?: string } when the user exits.
|
|
484
490
|
*/
|
|
485
|
-
onFundWallet?: (params: FundWalletParams) => Promise<
|
|
486
|
-
funded: boolean;
|
|
487
|
-
}> | void;
|
|
491
|
+
onFundWallet?: (params: FundWalletParams) => Promise<FundWalletResult> | void;
|
|
488
492
|
/** Optional view to show immediately when the popup opens. */
|
|
489
493
|
initialView?: LoginPopupView;
|
|
490
494
|
/** Handler invoked when the user selects "Sign in with Wallet". */
|
|
@@ -535,6 +539,7 @@ type HeaderProps = {
|
|
|
535
539
|
onProfileNavigate?: () => void;
|
|
536
540
|
onOrdersNavigate?: () => void;
|
|
537
541
|
onWalletNavigate?: () => void;
|
|
542
|
+
showTradeTab?: boolean;
|
|
538
543
|
};
|
|
539
544
|
declare const Header: React__default.FC<HeaderProps>;
|
|
540
545
|
|
package/dist/index.js
CHANGED
|
@@ -4472,7 +4472,8 @@ var Header = ({
|
|
|
4472
4472
|
onTradeClick,
|
|
4473
4473
|
onProfileNavigate: _onProfileNavigate,
|
|
4474
4474
|
onOrdersNavigate: _onOrdersNavigate,
|
|
4475
|
-
onWalletNavigate: _onWalletNavigate
|
|
4475
|
+
onWalletNavigate: _onWalletNavigate,
|
|
4476
|
+
showTradeTab = true
|
|
4476
4477
|
}) => {
|
|
4477
4478
|
const [isUserMenuOpen, setIsUserMenuOpen] = React5.useState(false);
|
|
4478
4479
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = React5.useState(false);
|
|
@@ -4562,6 +4563,9 @@ var Header = ({
|
|
|
4562
4563
|
performNavigation(resolvedLoafLiquidityPath);
|
|
4563
4564
|
};
|
|
4564
4565
|
const handleTradeNavigation = () => {
|
|
4566
|
+
if (!showTradeTab) {
|
|
4567
|
+
return;
|
|
4568
|
+
}
|
|
4565
4569
|
closeMenus();
|
|
4566
4570
|
if (onTradeClick) {
|
|
4567
4571
|
onTradeClick();
|
|
@@ -4659,7 +4663,7 @@ var Header = ({
|
|
|
4659
4663
|
const resolvedPortfolioPath = portfolioPath ?? DEFAULT_PORTFOLIO_PATH;
|
|
4660
4664
|
const resolvedLoafLiquidityPath = loafLiquidityPath ?? DEFAULT_LOAF_LIQUIDITY_PATH;
|
|
4661
4665
|
const inferredActiveTab = (() => {
|
|
4662
|
-
if (locationPath === resolvedTradePath) return "trade";
|
|
4666
|
+
if (showTradeTab && locationPath === resolvedTradePath) return "trade";
|
|
4663
4667
|
if (locationPath === resolvedHomePath) return "home";
|
|
4664
4668
|
if (locationPath === resolvedAboutPath) return "about";
|
|
4665
4669
|
if (locationPath === resolvedLearnPath) return "learn";
|
|
@@ -4669,7 +4673,7 @@ var Header = ({
|
|
|
4669
4673
|
return null;
|
|
4670
4674
|
})();
|
|
4671
4675
|
const resolvedActiveTab = activeTab ?? inferredActiveTab;
|
|
4672
|
-
const tradeActive = resolvedActiveTab === "trade";
|
|
4676
|
+
const tradeActive = showTradeTab && resolvedActiveTab === "trade";
|
|
4673
4677
|
const homeActive = resolvedActiveTab === "home";
|
|
4674
4678
|
const offeringsActive = resolvedActiveTab === "offerings";
|
|
4675
4679
|
const propertyMapActive = resolvedActiveTab === "propertyMap";
|
|
@@ -4706,25 +4710,25 @@ var Header = ({
|
|
|
4706
4710
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4707
4711
|
NavLink,
|
|
4708
4712
|
{
|
|
4709
|
-
href:
|
|
4710
|
-
className:
|
|
4713
|
+
href: resolvedPortfolioPath,
|
|
4714
|
+
className: portfolioActive ? "active" : "",
|
|
4711
4715
|
onClick: (event) => {
|
|
4712
4716
|
event.preventDefault();
|
|
4713
|
-
|
|
4717
|
+
handleNavigation(resolvedPortfolioPath);
|
|
4714
4718
|
},
|
|
4715
|
-
children: "
|
|
4719
|
+
children: "Portfolio"
|
|
4716
4720
|
}
|
|
4717
4721
|
),
|
|
4718
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4722
|
+
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4719
4723
|
NavLink,
|
|
4720
4724
|
{
|
|
4721
|
-
href:
|
|
4722
|
-
className:
|
|
4725
|
+
href: resolvedTradePath,
|
|
4726
|
+
className: tradeActive ? "active" : "",
|
|
4723
4727
|
onClick: (event) => {
|
|
4724
4728
|
event.preventDefault();
|
|
4725
|
-
|
|
4729
|
+
handleTradeNavigation();
|
|
4726
4730
|
},
|
|
4727
|
-
children: "
|
|
4731
|
+
children: "Trade"
|
|
4728
4732
|
}
|
|
4729
4733
|
),
|
|
4730
4734
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4802,6 +4806,13 @@ var Header = ({
|
|
|
4802
4806
|
] }),
|
|
4803
4807
|
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedHomePath), children: "Home" }),
|
|
4804
4808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4809
|
+
MobileNavItem,
|
|
4810
|
+
{
|
|
4811
|
+
onClick: () => handleNavigation(resolvedPortfolioPath),
|
|
4812
|
+
children: "Portfolio"
|
|
4813
|
+
}
|
|
4814
|
+
),
|
|
4815
|
+
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4805
4816
|
MobileNavItem,
|
|
4806
4817
|
{
|
|
4807
4818
|
onClick: () => {
|
|
@@ -4810,7 +4821,6 @@ var Header = ({
|
|
|
4810
4821
|
children: "Trade"
|
|
4811
4822
|
}
|
|
4812
4823
|
),
|
|
4813
|
-
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPortfolioPath), children: "Portfolio" }),
|
|
4814
4824
|
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(offeringsHref), children: "Initial Offerings" }),
|
|
4815
4825
|
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedPropertyMapPath), children: "Property Map" }),
|
|
4816
4826
|
/* @__PURE__ */ jsxRuntime.jsx(MobileNavItem, { onClick: () => handleNavigation(resolvedLearnPath), children: "Learn" }),
|
|
@@ -5467,8 +5477,10 @@ var LoginPopup = ({
|
|
|
5467
5477
|
const [fundingAmount, setFundingAmount] = React5.useState("");
|
|
5468
5478
|
const [kycLoading, setKycLoading] = React5.useState(false);
|
|
5469
5479
|
const [showKycWidget, setShowKycWidget] = React5.useState(false);
|
|
5470
|
-
const [
|
|
5480
|
+
const [cryptoFundingLoading, setCryptoFundingLoading] = React5.useState(false);
|
|
5481
|
+
const [fiatFundingLoading, setFiatFundingLoading] = React5.useState(false);
|
|
5471
5482
|
const [fundingError, setFundingError] = React5.useState("");
|
|
5483
|
+
const [transakWidgetUrl, setTransakWidgetUrl] = React5.useState(null);
|
|
5472
5484
|
const suppressAutoCloseRef = React5__namespace.default.useRef(false);
|
|
5473
5485
|
React5.useEffect(() => {
|
|
5474
5486
|
console.log("[LoginTrace][Popup] mounted");
|
|
@@ -5486,6 +5498,35 @@ var LoginPopup = ({
|
|
|
5486
5498
|
setView(initialView);
|
|
5487
5499
|
}
|
|
5488
5500
|
}, [initialView]);
|
|
5501
|
+
React5.useEffect(() => {
|
|
5502
|
+
if (!transakWidgetUrl) return;
|
|
5503
|
+
const handleTransakMessage = (event) => {
|
|
5504
|
+
if (!event.origin.includes("transak.com") && !event.origin.includes("global.transak.com")) {
|
|
5505
|
+
return;
|
|
5506
|
+
}
|
|
5507
|
+
console.log("[LoginTrace][Popup] Transak message received", event.data);
|
|
5508
|
+
try {
|
|
5509
|
+
const data = typeof event.data === "string" ? JSON.parse(event.data) : event.data;
|
|
5510
|
+
if (data.event_id === "TRANSAK_ORDER_SUCCESSFUL") {
|
|
5511
|
+
console.log("[LoginTrace][Popup] Transak order successful", data);
|
|
5512
|
+
setTimeout(() => {
|
|
5513
|
+
onClose();
|
|
5514
|
+
}, 2e3);
|
|
5515
|
+
} else if (data.event_id === "TRANSAK_ORDER_FAILED") {
|
|
5516
|
+
console.error("[LoginTrace][Popup] Transak order failed", data);
|
|
5517
|
+
setFundingError("Transaction failed. Please try again.");
|
|
5518
|
+
setTransakWidgetUrl(null);
|
|
5519
|
+
} else if (data.event_id === "TRANSAK_WIDGET_CLOSE") {
|
|
5520
|
+
console.log("[LoginTrace][Popup] Transak widget closed by user");
|
|
5521
|
+
setTransakWidgetUrl(null);
|
|
5522
|
+
}
|
|
5523
|
+
} catch (err) {
|
|
5524
|
+
console.warn("[LoginTrace][Popup] Failed to parse Transak message", err);
|
|
5525
|
+
}
|
|
5526
|
+
};
|
|
5527
|
+
window.addEventListener("message", handleTransakMessage);
|
|
5528
|
+
return () => window.removeEventListener("message", handleTransakMessage);
|
|
5529
|
+
}, [transakWidgetUrl, onClose]);
|
|
5489
5530
|
React5.useEffect(() => {
|
|
5490
5531
|
if (!autoCloseOnAuth) {
|
|
5491
5532
|
console.log("[LoginTrace][Popup] autoClose disabled", { autoCloseOnAuth, view });
|
|
@@ -5669,6 +5710,10 @@ var LoginPopup = ({
|
|
|
5669
5710
|
setView("kyc-failed");
|
|
5670
5711
|
}
|
|
5671
5712
|
};
|
|
5713
|
+
const handleKycWidgetClose = () => {
|
|
5714
|
+
setShowKycWidget(false);
|
|
5715
|
+
onClose();
|
|
5716
|
+
};
|
|
5672
5717
|
const handleKycStart = async () => {
|
|
5673
5718
|
if (renderKycWidget) {
|
|
5674
5719
|
setShowKycWidget(true);
|
|
@@ -5696,28 +5741,54 @@ var LoginPopup = ({
|
|
|
5696
5741
|
const handleKycSkip = () => {
|
|
5697
5742
|
onClose();
|
|
5698
5743
|
};
|
|
5699
|
-
const
|
|
5744
|
+
const handleCryptoFund = async () => {
|
|
5700
5745
|
if (!onFundWallet) {
|
|
5701
5746
|
onClose();
|
|
5702
5747
|
return;
|
|
5703
5748
|
}
|
|
5704
|
-
setFundingLoading(true);
|
|
5705
5749
|
setFundingError("");
|
|
5750
|
+
setCryptoFundingLoading(true);
|
|
5706
5751
|
try {
|
|
5707
|
-
const result = await onFundWallet({ amount: fundingAmount || "100" });
|
|
5708
|
-
if (result
|
|
5752
|
+
const result = await onFundWallet({ amount: fundingAmount || "100", mode: "crypto" });
|
|
5753
|
+
if (result?.funded) {
|
|
5754
|
+
onClose();
|
|
5755
|
+
}
|
|
5756
|
+
} catch (err) {
|
|
5757
|
+
setFundingError(err instanceof Error ? err.message : "Unable to launch funding. Please try again.");
|
|
5758
|
+
} finally {
|
|
5759
|
+
setCryptoFundingLoading(false);
|
|
5760
|
+
}
|
|
5761
|
+
};
|
|
5762
|
+
const handleFiatFund = async () => {
|
|
5763
|
+
if (!onFundWallet) {
|
|
5764
|
+
onClose();
|
|
5765
|
+
return;
|
|
5766
|
+
}
|
|
5767
|
+
setFundingError("");
|
|
5768
|
+
setFiatFundingLoading(true);
|
|
5769
|
+
try {
|
|
5770
|
+
const result = await onFundWallet({ amount: fundingAmount || "100", mode: "fiat" });
|
|
5771
|
+
if (result?.widgetUrl) {
|
|
5772
|
+
setTransakWidgetUrl(result.widgetUrl);
|
|
5773
|
+
} else if (result?.requiresKyc) {
|
|
5774
|
+
setView("kyc");
|
|
5775
|
+
setShowKycWidget(true);
|
|
5776
|
+
} else if (result?.funded) {
|
|
5709
5777
|
onClose();
|
|
5710
|
-
} else {
|
|
5711
|
-
setFundingLoading(false);
|
|
5712
5778
|
}
|
|
5713
5779
|
} catch (err) {
|
|
5714
5780
|
setFundingError(err instanceof Error ? err.message : "Unable to launch funding. Please try again.");
|
|
5715
|
-
|
|
5781
|
+
} finally {
|
|
5782
|
+
setFiatFundingLoading(false);
|
|
5716
5783
|
}
|
|
5717
5784
|
};
|
|
5718
5785
|
const handleFundingSkip = () => {
|
|
5719
5786
|
onClose();
|
|
5720
5787
|
};
|
|
5788
|
+
const handleTransakClose = () => {
|
|
5789
|
+
setTransakWidgetUrl(null);
|
|
5790
|
+
setFundingError("");
|
|
5791
|
+
};
|
|
5721
5792
|
const handleFundingAmountChange = (event) => {
|
|
5722
5793
|
const next = event.target.value.replace(/[^0-9.]/g, "");
|
|
5723
5794
|
setFundingAmount(next);
|
|
@@ -5893,7 +5964,10 @@ var LoginPopup = ({
|
|
|
5893
5964
|
$expanded: showKycWidget,
|
|
5894
5965
|
children: [
|
|
5895
5966
|
/* @__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" }) }) }),
|
|
5896
|
-
showKycWidget && renderKycWidget ? /* @__PURE__ */ jsxRuntime.
|
|
5967
|
+
showKycWidget && renderKycWidget ? /* @__PURE__ */ jsxRuntime.jsxs(KycWidgetContainer, { children: [
|
|
5968
|
+
/* @__PURE__ */ jsxRuntime.jsx(InlineCloseButton, { onClick: handleKycWidgetClose, "aria-label": "Close KYC widget", 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" }) }) }),
|
|
5969
|
+
renderKycWidget(handleKycWidgetResult)
|
|
5970
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(OnboardingStepContainer, { children: [
|
|
5897
5971
|
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "KYC to Continue" }),
|
|
5898
5972
|
/* @__PURE__ */ jsxRuntime.jsx(OnboardingSubtext, { children: "Loaf requires all users to KYC before they can start purchasing properties." }),
|
|
5899
5973
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingButtonGroup, { children: [
|
|
@@ -5911,15 +5985,14 @@ var LoginPopup = ({
|
|
|
5911
5985
|
/* @__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" }) }) }),
|
|
5912
5986
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingStepContainer, { children: [
|
|
5913
5987
|
/* @__PURE__ */ jsxRuntime.jsx(KycSuccessIcon, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 34.5L28.5 43 44 25", stroke: "var(--color-accent, #e6c656)", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
|
|
5914
|
-
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "
|
|
5988
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "KYC pending review" }),
|
|
5915
5989
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingSubtext, { children: [
|
|
5916
|
-
"
|
|
5917
|
-
/* @__PURE__ */ jsxRuntime.jsx("br", {})
|
|
5918
|
-
"You can start purchasing properties."
|
|
5990
|
+
"Thanks for submitting your documents.",
|
|
5991
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {})
|
|
5919
5992
|
] }),
|
|
5920
5993
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingButtonGroup, { children: [
|
|
5921
|
-
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { onClick:
|
|
5922
|
-
/* @__PURE__ */ jsxRuntime.jsx(OnboardingSkipButton, { onClick:
|
|
5994
|
+
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { onClick: onClose, children: "Close" }),
|
|
5995
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnboardingSkipButton, { onClick: () => setView("funding"), children: "Fund now" })
|
|
5923
5996
|
] })
|
|
5924
5997
|
] })
|
|
5925
5998
|
] }) });
|
|
@@ -5955,32 +6028,62 @@ var LoginPopup = ({
|
|
|
5955
6028
|
] }) });
|
|
5956
6029
|
}
|
|
5957
6030
|
if (view === "funding") {
|
|
5958
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Overlay2, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5965
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5966
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5967
|
-
|
|
5968
|
-
|
|
6031
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Overlay2, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6032
|
+
FundingPopupContainer,
|
|
6033
|
+
{
|
|
6034
|
+
onClick: (event) => event.stopPropagation(),
|
|
6035
|
+
$hasWidget: !!transakWidgetUrl,
|
|
6036
|
+
children: [
|
|
6037
|
+
/* @__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" }) }) }),
|
|
6038
|
+
transakWidgetUrl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6039
|
+
/* @__PURE__ */ jsxRuntime.jsxs(BackButton, { onClick: handleTransakClose, style: { position: "absolute", top: "1rem", left: "1rem", zIndex: 1 }, children: [
|
|
6040
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) }),
|
|
6041
|
+
"Back"
|
|
6042
|
+
] }),
|
|
6043
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransakWidgetContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6044
|
+
TransakIframe,
|
|
5969
6045
|
{
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
onChange: handleFundingAmountChange,
|
|
5974
|
-
placeholder: "0"
|
|
6046
|
+
src: transakWidgetUrl,
|
|
6047
|
+
title: "Transak Onramp Widget",
|
|
6048
|
+
allow: "camera; microphone; payment"
|
|
5975
6049
|
}
|
|
5976
|
-
)
|
|
5977
|
-
] }),
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
6050
|
+
) })
|
|
6051
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(OnboardingStepContainer, { children: [
|
|
6052
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "Fund your account" }),
|
|
6053
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FundingCard, { children: [
|
|
6054
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingCardLabel, { children: "How much would you like to transfer?" }),
|
|
6055
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FundingInputWrapper, { children: [
|
|
6056
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingCurrencyLabel, { children: "AUD" }),
|
|
6057
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6058
|
+
FundingAmountInput,
|
|
6059
|
+
{
|
|
6060
|
+
type: "text",
|
|
6061
|
+
inputMode: "decimal",
|
|
6062
|
+
value: fundingAmount,
|
|
6063
|
+
onChange: handleFundingAmountChange,
|
|
6064
|
+
placeholder: "0"
|
|
6065
|
+
}
|
|
6066
|
+
)
|
|
6067
|
+
] }),
|
|
6068
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FundingOptionsGrid, { children: [
|
|
6069
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FundingOptionCard, { children: [
|
|
6070
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingOptionHeading, { children: "Crypto transfer" }),
|
|
6071
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingOptionSubtext, { children: "Use Privy's Coinbase onramp to move crypto from another exchange or wallet." }),
|
|
6072
|
+
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { onClick: handleCryptoFund, disabled: cryptoFundingLoading, children: cryptoFundingLoading ? "Opening Coinbase\u2026" : "Use crypto deposit" })
|
|
6073
|
+
] }),
|
|
6074
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FundingOptionCard, { children: [
|
|
6075
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingOptionHeading, { children: "Fiat onramp" }),
|
|
6076
|
+
/* @__PURE__ */ jsxRuntime.jsx(FundingOptionSubtext, { children: "Buy USDC instantly with your card or local payment methods via Transak." }),
|
|
6077
|
+
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { onClick: handleFiatFund, disabled: fiatFundingLoading, children: fiatFundingLoading ? "Loading widget\u2026" : "Use onramp" })
|
|
6078
|
+
] })
|
|
6079
|
+
] }),
|
|
6080
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnboardingSkipButton, { onClick: handleFundingSkip, style: { marginTop: "1.25rem" }, children: "Skip for now" }),
|
|
6081
|
+
fundingError && /* @__PURE__ */ jsxRuntime.jsx(StatusMessage, { $error: true, children: fundingError })
|
|
6082
|
+
] })
|
|
6083
|
+
] })
|
|
6084
|
+
]
|
|
6085
|
+
}
|
|
6086
|
+
) });
|
|
5984
6087
|
}
|
|
5985
6088
|
return null;
|
|
5986
6089
|
};
|
|
@@ -6067,6 +6170,34 @@ var KycWidgetContainer = styled23__default.default.div`
|
|
|
6067
6170
|
width: 100%;
|
|
6068
6171
|
display: flex;
|
|
6069
6172
|
flex-direction: column;
|
|
6173
|
+
position: relative;
|
|
6174
|
+
gap: 0.75rem;
|
|
6175
|
+
`;
|
|
6176
|
+
var InlineCloseButton = styled23__default.default.button`
|
|
6177
|
+
position: absolute;
|
|
6178
|
+
top: -12px;
|
|
6179
|
+
right: -12px;
|
|
6180
|
+
background: rgba(0, 0, 0, 0.4);
|
|
6181
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
6182
|
+
border-radius: 999px;
|
|
6183
|
+
color: var(--color-text-secondary, #848e9c);
|
|
6184
|
+
width: 32px;
|
|
6185
|
+
height: 32px;
|
|
6186
|
+
display: flex;
|
|
6187
|
+
align-items: center;
|
|
6188
|
+
justify-content: center;
|
|
6189
|
+
cursor: pointer;
|
|
6190
|
+
transition: color 0.2s ease, background 0.2s ease;
|
|
6191
|
+
|
|
6192
|
+
&:hover {
|
|
6193
|
+
background: rgba(0, 0, 0, 0.6);
|
|
6194
|
+
color: var(--color-accent, #e6c656);
|
|
6195
|
+
}
|
|
6196
|
+
|
|
6197
|
+
svg {
|
|
6198
|
+
width: 18px;
|
|
6199
|
+
height: 18px;
|
|
6200
|
+
}
|
|
6070
6201
|
`;
|
|
6071
6202
|
var CloseButton = styled23__default.default.button`
|
|
6072
6203
|
position: absolute;
|
|
@@ -6240,7 +6371,7 @@ var OTPInput = styled23__default.default.input`
|
|
|
6240
6371
|
`;
|
|
6241
6372
|
var SubmitButton = styled23__default.default.button`
|
|
6242
6373
|
width: 100%;
|
|
6243
|
-
padding:
|
|
6374
|
+
padding: 0.85rem;
|
|
6244
6375
|
background-color: var(--color-accent, #e6c656);
|
|
6245
6376
|
border: none;
|
|
6246
6377
|
border-radius: var(--border-radius, 8px);
|
|
@@ -6287,13 +6418,14 @@ var OnboardingStepContainer = styled23__default.default.div`
|
|
|
6287
6418
|
flex-direction: column;
|
|
6288
6419
|
align-items: center;
|
|
6289
6420
|
text-align: center;
|
|
6290
|
-
padding:
|
|
6421
|
+
padding: 0.25rem 0;
|
|
6422
|
+
gap: 0.5rem;
|
|
6291
6423
|
`;
|
|
6292
6424
|
var OnboardingHeading = styled23__default.default.h2`
|
|
6293
|
-
font-size: 1.
|
|
6425
|
+
font-size: 1.2rem;
|
|
6294
6426
|
font-weight: 600;
|
|
6295
6427
|
color: var(--color-text, #eaecef);
|
|
6296
|
-
margin
|
|
6428
|
+
margin: 0;
|
|
6297
6429
|
`;
|
|
6298
6430
|
var OnboardingSubtext = styled23__default.default.p`
|
|
6299
6431
|
font-size: 0.95rem;
|
|
@@ -6309,7 +6441,7 @@ var OnboardingButtonGroup = styled23__default.default.div`
|
|
|
6309
6441
|
`;
|
|
6310
6442
|
var OnboardingSkipButton = styled23__default.default.button`
|
|
6311
6443
|
width: 100%;
|
|
6312
|
-
padding: 0.
|
|
6444
|
+
padding: 0.75rem 0.9rem;
|
|
6313
6445
|
background-color: rgba(255, 255, 255, 0.05);
|
|
6314
6446
|
border: none;
|
|
6315
6447
|
border-radius: var(--border-radius, 8px);
|
|
@@ -6346,22 +6478,22 @@ var KycFailedIcon = styled23__default.default.div`
|
|
|
6346
6478
|
`;
|
|
6347
6479
|
var FundingCard = styled23__default.default.div`
|
|
6348
6480
|
width: 100%;
|
|
6349
|
-
border-radius:
|
|
6481
|
+
border-radius: 14px;
|
|
6350
6482
|
background-color: var(--color-background-light, #14151e);
|
|
6351
|
-
padding:
|
|
6483
|
+
padding: 1rem;
|
|
6352
6484
|
text-align: left;
|
|
6353
|
-
box-shadow: 0
|
|
6485
|
+
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
|
|
6354
6486
|
`;
|
|
6355
6487
|
var FundingCardLabel = styled23__default.default.p`
|
|
6356
|
-
font-size:
|
|
6488
|
+
font-size: 0.9rem;
|
|
6357
6489
|
color: var(--color-text, #eaecef);
|
|
6358
|
-
margin-bottom:
|
|
6490
|
+
margin-bottom: 0.5rem;
|
|
6359
6491
|
`;
|
|
6360
6492
|
var FundingInputWrapper = styled23__default.default.div`
|
|
6361
|
-
border-radius:
|
|
6362
|
-
border: 1px solid rgba(255, 255, 255, 0.
|
|
6493
|
+
border-radius: 12px;
|
|
6494
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
6363
6495
|
background-color: var(--color-background, #0d0e14);
|
|
6364
|
-
padding:
|
|
6496
|
+
padding: 0.75rem 0.85rem;
|
|
6365
6497
|
`;
|
|
6366
6498
|
var FundingCurrencyLabel = styled23__default.default.label`
|
|
6367
6499
|
display: block;
|
|
@@ -6375,10 +6507,10 @@ var FundingAmountInput = styled23__default.default.input`
|
|
|
6375
6507
|
background: transparent;
|
|
6376
6508
|
border: none;
|
|
6377
6509
|
outline: none;
|
|
6378
|
-
font-size:
|
|
6510
|
+
font-size: 1.7rem;
|
|
6379
6511
|
font-weight: 400;
|
|
6380
6512
|
color: var(--color-text, #eaecef);
|
|
6381
|
-
margin-top: 0.
|
|
6513
|
+
margin-top: 0.4rem;
|
|
6382
6514
|
font-family: "Geist Mono", "Space Grotesk", monospace;
|
|
6383
6515
|
font-variant-numeric: slashed-zero;
|
|
6384
6516
|
|
|
@@ -6386,6 +6518,79 @@ var FundingAmountInput = styled23__default.default.input`
|
|
|
6386
6518
|
color: rgba(255, 255, 255, 0.4);
|
|
6387
6519
|
}
|
|
6388
6520
|
`;
|
|
6521
|
+
var FundingOptionsGrid = styled23__default.default.div`
|
|
6522
|
+
display: grid;
|
|
6523
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
6524
|
+
gap: 0.6rem;
|
|
6525
|
+
margin-top: 0.75rem;
|
|
6526
|
+
`;
|
|
6527
|
+
var FundingOptionCard = styled23__default.default.div`
|
|
6528
|
+
background-color: rgba(255, 255, 255, 0.03);
|
|
6529
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
6530
|
+
border-radius: 12px;
|
|
6531
|
+
padding: 0.85rem;
|
|
6532
|
+
display: flex;
|
|
6533
|
+
flex-direction: column;
|
|
6534
|
+
gap: 0.4rem;
|
|
6535
|
+
`;
|
|
6536
|
+
var FundingOptionHeading = styled23__default.default.h4`
|
|
6537
|
+
margin: 0;
|
|
6538
|
+
font-size: 0.9rem;
|
|
6539
|
+
color: var(--color-text, #eaecef);
|
|
6540
|
+
`;
|
|
6541
|
+
var FundingOptionSubtext = styled23__default.default.p`
|
|
6542
|
+
margin: 0;
|
|
6543
|
+
font-size: 0.75rem;
|
|
6544
|
+
line-height: 1.3;
|
|
6545
|
+
color: var(--color-text-secondary, #848e9c);
|
|
6546
|
+
flex: 1;
|
|
6547
|
+
`;
|
|
6548
|
+
var FundingPopupContainer = styled23__default.default.div`
|
|
6549
|
+
background-color: var(--color-background, #0a0a0a);
|
|
6550
|
+
border: 1px solid rgba(230, 198, 86, 0.3);
|
|
6551
|
+
border-radius: var(--border-radius, 12px);
|
|
6552
|
+
padding: ${(props) => props.$hasWidget ? "0" : "2.5rem"};
|
|
6553
|
+
max-width: ${(props) => props.$hasWidget ? "900px" : "440px"};
|
|
6554
|
+
width: 90%;
|
|
6555
|
+
position: relative;
|
|
6556
|
+
animation: slideUp 0.3s ease-out;
|
|
6557
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
|
6558
|
+
overflow: hidden;
|
|
6559
|
+
|
|
6560
|
+
@keyframes slideUp {
|
|
6561
|
+
from {
|
|
6562
|
+
transform: translateY(20px);
|
|
6563
|
+
opacity: 0;
|
|
6564
|
+
}
|
|
6565
|
+
to {
|
|
6566
|
+
transform: translateY(0);
|
|
6567
|
+
opacity: 1;
|
|
6568
|
+
}
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6571
|
+
@media (max-width: 768px) {
|
|
6572
|
+
padding: ${(props) => props.$hasWidget ? "0" : "2rem"};
|
|
6573
|
+
max-width: 95%;
|
|
6574
|
+
}
|
|
6575
|
+
`;
|
|
6576
|
+
var TransakWidgetContainer = styled23__default.default.div`
|
|
6577
|
+
width: 100%;
|
|
6578
|
+
height: 700px;
|
|
6579
|
+
display: flex;
|
|
6580
|
+
flex-direction: column;
|
|
6581
|
+
border-radius: var(--border-radius, 12px);
|
|
6582
|
+
overflow: hidden;
|
|
6583
|
+
|
|
6584
|
+
@media (max-width: 768px) {
|
|
6585
|
+
height: 600px;
|
|
6586
|
+
}
|
|
6587
|
+
`;
|
|
6588
|
+
var TransakIframe = styled23__default.default.iframe`
|
|
6589
|
+
width: 100%;
|
|
6590
|
+
height: 100%;
|
|
6591
|
+
border: none;
|
|
6592
|
+
border-radius: var(--border-radius, 12px);
|
|
6593
|
+
`;
|
|
6389
6594
|
var MiniLiveFeed = () => {
|
|
6390
6595
|
const [purchases, setPurchases] = React5.useState([]);
|
|
6391
6596
|
React5.useEffect(() => {
|
|
@@ -10414,8 +10619,7 @@ function PropertyBuy({
|
|
|
10414
10619
|
setLastOrderDetails({
|
|
10415
10620
|
tokens: tokenAmountInt,
|
|
10416
10621
|
total: orderTotal,
|
|
10417
|
-
price: tokenPrice
|
|
10418
|
-
orderNumber: Math.floor(1e7 + Math.random() * 9e7)
|
|
10622
|
+
price: tokenPrice
|
|
10419
10623
|
});
|
|
10420
10624
|
setOrderPlacedSuccess(true);
|
|
10421
10625
|
setSliderValue(0);
|