@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.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) {
|
|
@@ -1920,6 +1926,9 @@ function SigninModal({ isOpen, onClose, onError }) {
|
|
|
1920
1926
|
const { requestEmailCode, verifyEmailCode, handleSocialLogin } = useVolrLogin();
|
|
1921
1927
|
const [currentScreen, setCurrentScreen] = useState("method-select");
|
|
1922
1928
|
const [email, setEmail] = useState("");
|
|
1929
|
+
useEffect(() => {
|
|
1930
|
+
console.log("[SigninModal] isOpen changed:", isOpen);
|
|
1931
|
+
}, [isOpen]);
|
|
1923
1932
|
const hasPasskey = user?.keyStorageType === "passkey";
|
|
1924
1933
|
const isMobile = useMediaQuery("(max-width: 500px)");
|
|
1925
1934
|
const isWideViewport = useMediaQuery("(min-width: 864px)");
|
|
@@ -2841,7 +2850,17 @@ var VolrUIProvider = ({
|
|
|
2841
2850
|
null
|
|
2842
2851
|
);
|
|
2843
2852
|
useEffect(() => {
|
|
2853
|
+
console.log("[VolrUIProvider] Injecting styles...");
|
|
2844
2854
|
ensureVolrStylesInjected();
|
|
2855
|
+
const styleElement = document.getElementById("volr-sdk-styles");
|
|
2856
|
+
if (styleElement) {
|
|
2857
|
+
console.log("[VolrUIProvider] \u2705 Styles injected successfully", {
|
|
2858
|
+
hasContent: !!styleElement.textContent,
|
|
2859
|
+
contentLength: styleElement.textContent?.length || 0
|
|
2860
|
+
});
|
|
2861
|
+
} else {
|
|
2862
|
+
console.error("[VolrUIProvider] \u274C Failed to inject styles");
|
|
2863
|
+
}
|
|
2845
2864
|
}, []);
|
|
2846
2865
|
useEffect(() => {
|
|
2847
2866
|
if (providerPolicy.enforceOnFirstLogin !== false && !keyStorageType) {
|
|
@@ -2913,9 +2932,13 @@ function LoginModalPortal() {
|
|
|
2913
2932
|
if (typeof window === "undefined") return;
|
|
2914
2933
|
let root = document.getElementById("volr-modal-root");
|
|
2915
2934
|
if (!root) {
|
|
2935
|
+
console.log("[LoginModalPortal] Creating volr-modal-root...");
|
|
2916
2936
|
root = document.createElement("div");
|
|
2917
2937
|
root.id = "volr-modal-root";
|
|
2918
2938
|
document.body.appendChild(root);
|
|
2939
|
+
console.log("[LoginModalPortal] \u2705 Portal root created");
|
|
2940
|
+
} else {
|
|
2941
|
+
console.log("[LoginModalPortal] \u2705 Portal root already exists");
|
|
2919
2942
|
}
|
|
2920
2943
|
setPortalRoot(root);
|
|
2921
2944
|
return () => {
|
|
@@ -2924,6 +2947,14 @@ function LoginModalPortal() {
|
|
|
2924
2947
|
}
|
|
2925
2948
|
};
|
|
2926
2949
|
}, []);
|
|
2950
|
+
useEffect(() => {
|
|
2951
|
+
console.log("[LoginModalPortal] State changed", {
|
|
2952
|
+
isOpen,
|
|
2953
|
+
mode,
|
|
2954
|
+
hasPortalRoot: !!portalRoot,
|
|
2955
|
+
shouldRender: isOpen && mode === "auth"
|
|
2956
|
+
});
|
|
2957
|
+
}, [isOpen, mode, portalRoot]);
|
|
2927
2958
|
const handleClose = () => {
|
|
2928
2959
|
console.log("[LoginModalPortal] handleClose called");
|
|
2929
2960
|
setError(null);
|