@volr/react-ui 0.1.31 → 0.1.32
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 +31 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -294,10 +294,13 @@ var VolrModalProvider = ({
|
|
|
294
294
|
const [mode, setMode] = React3.useState("auth");
|
|
295
295
|
const { user } = react.useVolr();
|
|
296
296
|
const open = React3.useCallback(() => {
|
|
297
|
+
console.log("[useVolrModal] open() called", { user: user?.id, hasUser: !!user });
|
|
297
298
|
setMode(user ? "deposit" : "auth");
|
|
298
299
|
setIsOpen(true);
|
|
300
|
+
console.log("[useVolrModal] isOpen set to true");
|
|
299
301
|
}, [user]);
|
|
300
302
|
const close = React3.useCallback(() => {
|
|
303
|
+
console.log("[useVolrModal] close() called");
|
|
301
304
|
setIsOpen(false);
|
|
302
305
|
}, []);
|
|
303
306
|
const toggle = React3.useCallback(() => {
|
|
@@ -338,6 +341,9 @@ var Modal = ({
|
|
|
338
341
|
}) => {
|
|
339
342
|
const isMobile = useMediaQuery("(max-width: 500px)");
|
|
340
343
|
const variant = explicitVariant ?? (isMobile ? "bottom-sheet" : "centered");
|
|
344
|
+
React3__default.default.useEffect(() => {
|
|
345
|
+
console.log("[Modal] State changed", { open, variant, isMobile });
|
|
346
|
+
}, [open, variant, isMobile]);
|
|
341
347
|
React3__default.default.useEffect(() => {
|
|
342
348
|
const handleEscape = (e) => {
|
|
343
349
|
if (e.key === "Escape" && open) {
|
|
@@ -1925,6 +1931,9 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
1925
1931
|
const { requestEmailCode, verifyEmailCode, handleSocialLogin } = react.useVolrLogin();
|
|
1926
1932
|
const [currentScreen, setCurrentScreen] = React3.useState("method-select");
|
|
1927
1933
|
const [email, setEmail] = React3.useState("");
|
|
1934
|
+
React3.useEffect(() => {
|
|
1935
|
+
console.log("[SigninModal] isOpen changed:", isOpen);
|
|
1936
|
+
}, [isOpen]);
|
|
1928
1937
|
const hasPasskey = user?.keyStorageType === "passkey";
|
|
1929
1938
|
const isMobile = useMediaQuery("(max-width: 500px)");
|
|
1930
1939
|
const isWideViewport = useMediaQuery("(min-width: 864px)");
|
|
@@ -2846,7 +2855,17 @@ var VolrUIProvider = ({
|
|
|
2846
2855
|
null
|
|
2847
2856
|
);
|
|
2848
2857
|
React3.useEffect(() => {
|
|
2858
|
+
console.log("[VolrUIProvider] Injecting styles...");
|
|
2849
2859
|
ensureVolrStylesInjected();
|
|
2860
|
+
const styleElement = document.getElementById("volr-sdk-styles");
|
|
2861
|
+
if (styleElement) {
|
|
2862
|
+
console.log("[VolrUIProvider] \u2705 Styles injected successfully", {
|
|
2863
|
+
hasContent: !!styleElement.textContent,
|
|
2864
|
+
contentLength: styleElement.textContent?.length || 0
|
|
2865
|
+
});
|
|
2866
|
+
} else {
|
|
2867
|
+
console.error("[VolrUIProvider] \u274C Failed to inject styles");
|
|
2868
|
+
}
|
|
2850
2869
|
}, []);
|
|
2851
2870
|
React3.useEffect(() => {
|
|
2852
2871
|
if (providerPolicy.enforceOnFirstLogin !== false && !keyStorageType) {
|
|
@@ -2918,9 +2937,13 @@ function LoginModalPortal() {
|
|
|
2918
2937
|
if (typeof window === "undefined") return;
|
|
2919
2938
|
let root = document.getElementById("volr-modal-root");
|
|
2920
2939
|
if (!root) {
|
|
2940
|
+
console.log("[LoginModalPortal] Creating volr-modal-root...");
|
|
2921
2941
|
root = document.createElement("div");
|
|
2922
2942
|
root.id = "volr-modal-root";
|
|
2923
2943
|
document.body.appendChild(root);
|
|
2944
|
+
console.log("[LoginModalPortal] \u2705 Portal root created");
|
|
2945
|
+
} else {
|
|
2946
|
+
console.log("[LoginModalPortal] \u2705 Portal root already exists");
|
|
2924
2947
|
}
|
|
2925
2948
|
setPortalRoot(root);
|
|
2926
2949
|
return () => {
|
|
@@ -2929,6 +2952,14 @@ function LoginModalPortal() {
|
|
|
2929
2952
|
}
|
|
2930
2953
|
};
|
|
2931
2954
|
}, []);
|
|
2955
|
+
React3.useEffect(() => {
|
|
2956
|
+
console.log("[LoginModalPortal] State changed", {
|
|
2957
|
+
isOpen,
|
|
2958
|
+
mode,
|
|
2959
|
+
hasPortalRoot: !!portalRoot,
|
|
2960
|
+
shouldRender: isOpen && mode === "auth"
|
|
2961
|
+
});
|
|
2962
|
+
}, [isOpen, mode, portalRoot]);
|
|
2932
2963
|
const handleClose = () => {
|
|
2933
2964
|
console.log("[LoginModalPortal] handleClose called");
|
|
2934
2965
|
setError(null);
|