Show Login and Ask an organizer sent and error states.
Connect the live modals to the drawn sent, expired, invalid-email, and send-failed screens, pin the phone footer above the keyboard, and send the light login email.
This commit is contained in:
1 parent
44010c7b73
commit
27d74e510c
29 files changed
+771
-281
No files matched your search
@@ -1,10 +1,12 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Figma: "Modal / Login" (see registry)
|
||||
* Figma: Overlay / Modal / Login (22078:587823)
|
||||
* Sent 25032:48263, link expired 25032:48370, invalid email 25032:48477
|
||||
*/
|
||||
|
||||
import { memo, useEffect, useLayoutEffect, useRef, useState } from "react";
|
||||
import { useVisualViewportHeight } from "../../../hooks";
|
||||
import { LoginView } from "./Login.view";
|
||||
import type { LoginProps } from "./Login.types";
|
||||
|
||||
@@ -24,9 +26,7 @@ const LoginContainer = memo<LoginProps>(
|
||||
const backdropRef = useRef<HTMLDivElement>(null);
|
||||
const previousActiveElementRef = useRef<HTMLElement | null>(null);
|
||||
const [portalReady, setPortalReady] = useState(() => !usePortal);
|
||||
const [viewportHeight, setViewportHeight] = useState<number | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const viewportHeight = useVisualViewportHeight(isOpen);
|
||||
|
||||
// Defer enabling the portal until after the layout commit so we don’t sync-setState
|
||||
// inside the effect (eslint react-hooks/set-state-in-effect) while still mounting
|
||||
@@ -39,24 +39,6 @@ const LoginContainer = memo<LoginProps>(
|
||||
return () => cancelAnimationFrame(id);
|
||||
}, [usePortal]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
const vp = window.visualViewport;
|
||||
const sync = () => {
|
||||
const next = vp?.height ?? window.innerHeight;
|
||||
setViewportHeight(next);
|
||||
};
|
||||
sync();
|
||||
vp?.addEventListener("resize", sync);
|
||||
vp?.addEventListener("scroll", sync);
|
||||
window.addEventListener("resize", sync);
|
||||
return () => {
|
||||
vp?.removeEventListener("resize", sync);
|
||||
vp?.removeEventListener("scroll", sync);
|
||||
window.removeEventListener("resize", sync);
|
||||
};
|
||||
}, [isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
if (usePortal && !portalReady) return;
|
||||
|
||||
Reference in new issue
Block a user