diff --git a/src/components/FirstVisitModal.tsx b/src/components/FirstVisitModal.tsx new file mode 100644 index 0000000..83c8bf8 --- /dev/null +++ b/src/components/FirstVisitModal.tsx @@ -0,0 +1,67 @@ +import { useEffect, useState } from "react"; + +interface FirstVisitModalProps { + isOpen: boolean; + onClose: () => void; +} + +export function FirstVisitModal({ isOpen, onClose }: FirstVisitModalProps) { + const [shouldRender, setShouldRender] = useState(isOpen); + const [animationClass, setAnimationClass] = useState(""); + + useEffect(() => { + if (isOpen) { + setShouldRender(true); + setAnimationClass("modal-enter"); + } else { + setAnimationClass("modal-exit"); + // Wait for animation to finish before unmounting + const timer = setTimeout(() => setShouldRender(false), 200); // match animation duration + return () => clearTimeout(timer); + } + }, [isOpen]); + + if (!shouldRender) return null; + + return ( +
+ Challenge your friends (or strangers) in a head-to-head skill games and earn from your victories!
+
+
+ Create or join duels, set an entry fee, and the winner takes all.
+
{desc}
+