@loafmarkets/ui 0.1.20 → 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 +259 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +259 -61
- 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";
|
|
@@ -4715,7 +4719,7 @@ var Header = ({
|
|
|
4715
4719
|
children: "Portfolio"
|
|
4716
4720
|
}
|
|
4717
4721
|
),
|
|
4718
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4722
|
+
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4719
4723
|
NavLink,
|
|
4720
4724
|
{
|
|
4721
4725
|
href: resolvedTradePath,
|
|
@@ -4808,7 +4812,7 @@ var Header = ({
|
|
|
4808
4812
|
children: "Portfolio"
|
|
4809
4813
|
}
|
|
4810
4814
|
),
|
|
4811
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4815
|
+
showTradeTab && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4812
4816
|
MobileNavItem,
|
|
4813
4817
|
{
|
|
4814
4818
|
onClick: () => {
|
|
@@ -5473,8 +5477,10 @@ var LoginPopup = ({
|
|
|
5473
5477
|
const [fundingAmount, setFundingAmount] = React5.useState("");
|
|
5474
5478
|
const [kycLoading, setKycLoading] = React5.useState(false);
|
|
5475
5479
|
const [showKycWidget, setShowKycWidget] = React5.useState(false);
|
|
5476
|
-
const [
|
|
5480
|
+
const [cryptoFundingLoading, setCryptoFundingLoading] = React5.useState(false);
|
|
5481
|
+
const [fiatFundingLoading, setFiatFundingLoading] = React5.useState(false);
|
|
5477
5482
|
const [fundingError, setFundingError] = React5.useState("");
|
|
5483
|
+
const [transakWidgetUrl, setTransakWidgetUrl] = React5.useState(null);
|
|
5478
5484
|
const suppressAutoCloseRef = React5__namespace.default.useRef(false);
|
|
5479
5485
|
React5.useEffect(() => {
|
|
5480
5486
|
console.log("[LoginTrace][Popup] mounted");
|
|
@@ -5492,6 +5498,35 @@ var LoginPopup = ({
|
|
|
5492
5498
|
setView(initialView);
|
|
5493
5499
|
}
|
|
5494
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]);
|
|
5495
5530
|
React5.useEffect(() => {
|
|
5496
5531
|
if (!autoCloseOnAuth) {
|
|
5497
5532
|
console.log("[LoginTrace][Popup] autoClose disabled", { autoCloseOnAuth, view });
|
|
@@ -5675,6 +5710,10 @@ var LoginPopup = ({
|
|
|
5675
5710
|
setView("kyc-failed");
|
|
5676
5711
|
}
|
|
5677
5712
|
};
|
|
5713
|
+
const handleKycWidgetClose = () => {
|
|
5714
|
+
setShowKycWidget(false);
|
|
5715
|
+
onClose();
|
|
5716
|
+
};
|
|
5678
5717
|
const handleKycStart = async () => {
|
|
5679
5718
|
if (renderKycWidget) {
|
|
5680
5719
|
setShowKycWidget(true);
|
|
@@ -5702,28 +5741,54 @@ var LoginPopup = ({
|
|
|
5702
5741
|
const handleKycSkip = () => {
|
|
5703
5742
|
onClose();
|
|
5704
5743
|
};
|
|
5705
|
-
const
|
|
5744
|
+
const handleCryptoFund = async () => {
|
|
5706
5745
|
if (!onFundWallet) {
|
|
5707
5746
|
onClose();
|
|
5708
5747
|
return;
|
|
5709
5748
|
}
|
|
5710
|
-
setFundingLoading(true);
|
|
5711
5749
|
setFundingError("");
|
|
5750
|
+
setCryptoFundingLoading(true);
|
|
5712
5751
|
try {
|
|
5713
|
-
const result = await onFundWallet({ amount: fundingAmount || "100" });
|
|
5714
|
-
if (result
|
|
5752
|
+
const result = await onFundWallet({ amount: fundingAmount || "100", mode: "crypto" });
|
|
5753
|
+
if (result?.funded) {
|
|
5715
5754
|
onClose();
|
|
5716
|
-
} else {
|
|
5717
|
-
setFundingLoading(false);
|
|
5718
5755
|
}
|
|
5719
5756
|
} catch (err) {
|
|
5720
5757
|
setFundingError(err instanceof Error ? err.message : "Unable to launch funding. Please try again.");
|
|
5721
|
-
|
|
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) {
|
|
5777
|
+
onClose();
|
|
5778
|
+
}
|
|
5779
|
+
} catch (err) {
|
|
5780
|
+
setFundingError(err instanceof Error ? err.message : "Unable to launch funding. Please try again.");
|
|
5781
|
+
} finally {
|
|
5782
|
+
setFiatFundingLoading(false);
|
|
5722
5783
|
}
|
|
5723
5784
|
};
|
|
5724
5785
|
const handleFundingSkip = () => {
|
|
5725
5786
|
onClose();
|
|
5726
5787
|
};
|
|
5788
|
+
const handleTransakClose = () => {
|
|
5789
|
+
setTransakWidgetUrl(null);
|
|
5790
|
+
setFundingError("");
|
|
5791
|
+
};
|
|
5727
5792
|
const handleFundingAmountChange = (event) => {
|
|
5728
5793
|
const next = event.target.value.replace(/[^0-9.]/g, "");
|
|
5729
5794
|
setFundingAmount(next);
|
|
@@ -5899,7 +5964,10 @@ var LoginPopup = ({
|
|
|
5899
5964
|
$expanded: showKycWidget,
|
|
5900
5965
|
children: [
|
|
5901
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" }) }) }),
|
|
5902
|
-
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: [
|
|
5903
5971
|
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "KYC to Continue" }),
|
|
5904
5972
|
/* @__PURE__ */ jsxRuntime.jsx(OnboardingSubtext, { children: "Loaf requires all users to KYC before they can start purchasing properties." }),
|
|
5905
5973
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingButtonGroup, { children: [
|
|
@@ -5917,15 +5985,14 @@ var LoginPopup = ({
|
|
|
5917
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" }) }) }),
|
|
5918
5986
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingStepContainer, { children: [
|
|
5919
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" }) }) }),
|
|
5920
|
-
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "
|
|
5988
|
+
/* @__PURE__ */ jsxRuntime.jsx(OnboardingHeading, { children: "KYC pending review" }),
|
|
5921
5989
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingSubtext, { children: [
|
|
5922
|
-
"
|
|
5923
|
-
/* @__PURE__ */ jsxRuntime.jsx("br", {})
|
|
5924
|
-
"You can start purchasing properties."
|
|
5990
|
+
"Thanks for submitting your documents.",
|
|
5991
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {})
|
|
5925
5992
|
] }),
|
|
5926
5993
|
/* @__PURE__ */ jsxRuntime.jsxs(OnboardingButtonGroup, { children: [
|
|
5927
|
-
/* @__PURE__ */ jsxRuntime.jsx(SubmitButton, { onClick:
|
|
5928
|
-
/* @__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" })
|
|
5929
5996
|
] })
|
|
5930
5997
|
] })
|
|
5931
5998
|
] }) });
|
|
@@ -5961,32 +6028,62 @@ var LoginPopup = ({
|
|
|
5961
6028
|
] }) });
|
|
5962
6029
|
}
|
|
5963
6030
|
if (view === "funding") {
|
|
5964
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Overlay2, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5971
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5972
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5973
|
-
|
|
5974
|
-
|
|
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,
|
|
5975
6045
|
{
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
onChange: handleFundingAmountChange,
|
|
5980
|
-
placeholder: "0"
|
|
6046
|
+
src: transakWidgetUrl,
|
|
6047
|
+
title: "Transak Onramp Widget",
|
|
6048
|
+
allow: "camera; microphone; payment"
|
|
5981
6049
|
}
|
|
5982
|
-
)
|
|
5983
|
-
] }),
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
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
|
+
) });
|
|
5990
6087
|
}
|
|
5991
6088
|
return null;
|
|
5992
6089
|
};
|
|
@@ -6073,6 +6170,34 @@ var KycWidgetContainer = styled23__default.default.div`
|
|
|
6073
6170
|
width: 100%;
|
|
6074
6171
|
display: flex;
|
|
6075
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
|
+
}
|
|
6076
6201
|
`;
|
|
6077
6202
|
var CloseButton = styled23__default.default.button`
|
|
6078
6203
|
position: absolute;
|
|
@@ -6246,7 +6371,7 @@ var OTPInput = styled23__default.default.input`
|
|
|
6246
6371
|
`;
|
|
6247
6372
|
var SubmitButton = styled23__default.default.button`
|
|
6248
6373
|
width: 100%;
|
|
6249
|
-
padding:
|
|
6374
|
+
padding: 0.85rem;
|
|
6250
6375
|
background-color: var(--color-accent, #e6c656);
|
|
6251
6376
|
border: none;
|
|
6252
6377
|
border-radius: var(--border-radius, 8px);
|
|
@@ -6293,13 +6418,14 @@ var OnboardingStepContainer = styled23__default.default.div`
|
|
|
6293
6418
|
flex-direction: column;
|
|
6294
6419
|
align-items: center;
|
|
6295
6420
|
text-align: center;
|
|
6296
|
-
padding:
|
|
6421
|
+
padding: 0.25rem 0;
|
|
6422
|
+
gap: 0.5rem;
|
|
6297
6423
|
`;
|
|
6298
6424
|
var OnboardingHeading = styled23__default.default.h2`
|
|
6299
|
-
font-size: 1.
|
|
6425
|
+
font-size: 1.2rem;
|
|
6300
6426
|
font-weight: 600;
|
|
6301
6427
|
color: var(--color-text, #eaecef);
|
|
6302
|
-
margin
|
|
6428
|
+
margin: 0;
|
|
6303
6429
|
`;
|
|
6304
6430
|
var OnboardingSubtext = styled23__default.default.p`
|
|
6305
6431
|
font-size: 0.95rem;
|
|
@@ -6315,7 +6441,7 @@ var OnboardingButtonGroup = styled23__default.default.div`
|
|
|
6315
6441
|
`;
|
|
6316
6442
|
var OnboardingSkipButton = styled23__default.default.button`
|
|
6317
6443
|
width: 100%;
|
|
6318
|
-
padding: 0.
|
|
6444
|
+
padding: 0.75rem 0.9rem;
|
|
6319
6445
|
background-color: rgba(255, 255, 255, 0.05);
|
|
6320
6446
|
border: none;
|
|
6321
6447
|
border-radius: var(--border-radius, 8px);
|
|
@@ -6352,22 +6478,22 @@ var KycFailedIcon = styled23__default.default.div`
|
|
|
6352
6478
|
`;
|
|
6353
6479
|
var FundingCard = styled23__default.default.div`
|
|
6354
6480
|
width: 100%;
|
|
6355
|
-
border-radius:
|
|
6481
|
+
border-radius: 14px;
|
|
6356
6482
|
background-color: var(--color-background-light, #14151e);
|
|
6357
|
-
padding:
|
|
6483
|
+
padding: 1rem;
|
|
6358
6484
|
text-align: left;
|
|
6359
|
-
box-shadow: 0
|
|
6485
|
+
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
|
|
6360
6486
|
`;
|
|
6361
6487
|
var FundingCardLabel = styled23__default.default.p`
|
|
6362
|
-
font-size:
|
|
6488
|
+
font-size: 0.9rem;
|
|
6363
6489
|
color: var(--color-text, #eaecef);
|
|
6364
|
-
margin-bottom:
|
|
6490
|
+
margin-bottom: 0.5rem;
|
|
6365
6491
|
`;
|
|
6366
6492
|
var FundingInputWrapper = styled23__default.default.div`
|
|
6367
|
-
border-radius:
|
|
6368
|
-
border: 1px solid rgba(255, 255, 255, 0.
|
|
6493
|
+
border-radius: 12px;
|
|
6494
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
6369
6495
|
background-color: var(--color-background, #0d0e14);
|
|
6370
|
-
padding:
|
|
6496
|
+
padding: 0.75rem 0.85rem;
|
|
6371
6497
|
`;
|
|
6372
6498
|
var FundingCurrencyLabel = styled23__default.default.label`
|
|
6373
6499
|
display: block;
|
|
@@ -6381,10 +6507,10 @@ var FundingAmountInput = styled23__default.default.input`
|
|
|
6381
6507
|
background: transparent;
|
|
6382
6508
|
border: none;
|
|
6383
6509
|
outline: none;
|
|
6384
|
-
font-size:
|
|
6510
|
+
font-size: 1.7rem;
|
|
6385
6511
|
font-weight: 400;
|
|
6386
6512
|
color: var(--color-text, #eaecef);
|
|
6387
|
-
margin-top: 0.
|
|
6513
|
+
margin-top: 0.4rem;
|
|
6388
6514
|
font-family: "Geist Mono", "Space Grotesk", monospace;
|
|
6389
6515
|
font-variant-numeric: slashed-zero;
|
|
6390
6516
|
|
|
@@ -6392,6 +6518,79 @@ var FundingAmountInput = styled23__default.default.input`
|
|
|
6392
6518
|
color: rgba(255, 255, 255, 0.4);
|
|
6393
6519
|
}
|
|
6394
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
|
+
`;
|
|
6395
6594
|
var MiniLiveFeed = () => {
|
|
6396
6595
|
const [purchases, setPurchases] = React5.useState([]);
|
|
6397
6596
|
React5.useEffect(() => {
|
|
@@ -10420,8 +10619,7 @@ function PropertyBuy({
|
|
|
10420
10619
|
setLastOrderDetails({
|
|
10421
10620
|
tokens: tokenAmountInt,
|
|
10422
10621
|
total: orderTotal,
|
|
10423
|
-
price: tokenPrice
|
|
10424
|
-
orderNumber: Math.floor(1e7 + Math.random() * 9e7)
|
|
10622
|
+
price: tokenPrice
|
|
10425
10623
|
});
|
|
10426
10624
|
setOrderPlacedSuccess(true);
|
|
10427
10625
|
setSliderValue(0);
|