@volr/react-ui 0.1.31 → 0.1.33
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.cjs +32 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -289,10 +289,13 @@ var VolrModalProvider = ({
|
|
|
289
289
|
const [mode, setMode] = useState("auth");
|
|
290
290
|
const { user } = useVolr();
|
|
291
291
|
const open = useCallback(() => {
|
|
292
|
+
console.log("[useVolrModal] open() called", { user: user?.id, hasUser: !!user });
|
|
292
293
|
setMode(user ? "deposit" : "auth");
|
|
293
294
|
setIsOpen(true);
|
|
295
|
+
console.log("[useVolrModal] isOpen set to true");
|
|
294
296
|
}, [user]);
|
|
295
297
|
const close = useCallback(() => {
|
|
298
|
+
console.log("[useVolrModal] close() called");
|
|
296
299
|
setIsOpen(false);
|
|
297
300
|
}, []);
|
|
298
301
|
const toggle = useCallback(() => {
|
|
@@ -333,6 +336,9 @@ var Modal = ({
|
|
|
333
336
|
}) => {
|
|
334
337
|
const isMobile = useMediaQuery("(max-width: 500px)");
|
|
335
338
|
const variant = explicitVariant ?? (isMobile ? "bottom-sheet" : "centered");
|
|
339
|
+
React3.useEffect(() => {
|
|
340
|
+
console.log("[Modal] State changed", { open, variant, isMobile });
|
|
341
|
+
}, [open, variant, isMobile]);
|
|
336
342
|
React3.useEffect(() => {
|
|
337
343
|
const handleEscape = (e) => {
|
|
338
344
|
if (e.key === "Escape" && open) {
|
|
@@ -350,7 +356,7 @@ var Modal = ({
|
|
|
350
356
|
}, [open, onOpenChange, onEscapeKeyDown]);
|
|
351
357
|
if (!open) return null;
|
|
352
358
|
const isBottomSheet = variant === "bottom-sheet";
|
|
353
|
-
return /* @__PURE__ */ jsxs(
|
|
359
|
+
return /* @__PURE__ */ jsxs("div", { "data-volr-root": "true", children: [
|
|
354
360
|
/* @__PURE__ */ jsx(
|
|
355
361
|
"div",
|
|
356
362
|
{
|
|
@@ -381,7 +387,6 @@ var Modal = ({
|
|
|
381
387
|
contentClassName
|
|
382
388
|
),
|
|
383
389
|
onClick: (e) => e.stopPropagation(),
|
|
384
|
-
"data-volr-root": "true",
|
|
385
390
|
children
|
|
386
391
|
}
|
|
387
392
|
)
|
|
@@ -1920,6 +1925,9 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
1920
1925
|
const { requestEmailCode, verifyEmailCode, handleSocialLogin } = useVolrLogin();
|
|
1921
1926
|
const [currentScreen, setCurrentScreen] = useState("method-select");
|
|
1922
1927
|
const [email, setEmail] = useState("");
|
|
1928
|
+
useEffect(() => {
|
|
1929
|
+
console.log("[SigninModal] isOpen changed:", isOpen);
|
|
1930
|
+
}, [isOpen]);
|
|
1923
1931
|
const hasPasskey = user?.keyStorageType === "passkey";
|
|
1924
1932
|
const isMobile = useMediaQuery("(max-width: 500px)");
|
|
1925
1933
|
const isWideViewport = useMediaQuery("(min-width: 864px)");
|
|
@@ -2841,7 +2849,17 @@ var VolrUIProvider = ({
|
|
|
2841
2849
|
null
|
|
2842
2850
|
);
|
|
2843
2851
|
useEffect(() => {
|
|
2852
|
+
console.log("[VolrUIProvider] Injecting styles...");
|
|
2844
2853
|
ensureVolrStylesInjected();
|
|
2854
|
+
const styleElement = document.getElementById("volr-sdk-styles");
|
|
2855
|
+
if (styleElement) {
|
|
2856
|
+
console.log("[VolrUIProvider] \u2705 Styles injected successfully", {
|
|
2857
|
+
hasContent: !!styleElement.textContent,
|
|
2858
|
+
contentLength: styleElement.textContent?.length || 0
|
|
2859
|
+
});
|
|
2860
|
+
} else {
|
|
2861
|
+
console.error("[VolrUIProvider] \u274C Failed to inject styles");
|
|
2862
|
+
}
|
|
2845
2863
|
}, []);
|
|
2846
2864
|
useEffect(() => {
|
|
2847
2865
|
if (providerPolicy.enforceOnFirstLogin !== false && !keyStorageType) {
|
|
@@ -2913,9 +2931,13 @@ function LoginModalPortal() {
|
|
|
2913
2931
|
if (typeof window === "undefined") return;
|
|
2914
2932
|
let root = document.getElementById("volr-modal-root");
|
|
2915
2933
|
if (!root) {
|
|
2934
|
+
console.log("[LoginModalPortal] Creating volr-modal-root...");
|
|
2916
2935
|
root = document.createElement("div");
|
|
2917
2936
|
root.id = "volr-modal-root";
|
|
2918
2937
|
document.body.appendChild(root);
|
|
2938
|
+
console.log("[LoginModalPortal] \u2705 Portal root created");
|
|
2939
|
+
} else {
|
|
2940
|
+
console.log("[LoginModalPortal] \u2705 Portal root already exists");
|
|
2919
2941
|
}
|
|
2920
2942
|
setPortalRoot(root);
|
|
2921
2943
|
return () => {
|
|
@@ -2924,6 +2946,14 @@ function LoginModalPortal() {
|
|
|
2924
2946
|
}
|
|
2925
2947
|
};
|
|
2926
2948
|
}, []);
|
|
2949
|
+
useEffect(() => {
|
|
2950
|
+
console.log("[LoginModalPortal] State changed", {
|
|
2951
|
+
isOpen,
|
|
2952
|
+
mode,
|
|
2953
|
+
hasPortalRoot: !!portalRoot,
|
|
2954
|
+
shouldRender: isOpen && mode === "auth"
|
|
2955
|
+
});
|
|
2956
|
+
}, [isOpen, mode, portalRoot]);
|
|
2927
2957
|
const handleClose = () => {
|
|
2928
2958
|
console.log("[LoginModalPortal] handleClose called");
|
|
2929
2959
|
setError(null);
|