import { useEffect, useState } from "react"; interface HowItWorksModalProps { isOpen: boolean; onClose: () => void; } export function HowItWorksModal({ isOpen, onClose }: HowItWorksModalProps) { 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 (
e.stopPropagation()} >

How It Works

{[ { step: "Sign In or Connect Your Wallet", desc: "Log in with X, Google, or connect your wallet. A secure wallet is created instantly with Privy." }, { step: "Create or Join a Game", desc: "Start a game with your own entry amount or join one that's already waiting." }, { step: "Enter the Game", desc: "Confirm your entry and stay on the website—the game will start automatically once all players are ready." }, { step: "Win and Get Paid", desc: "Win the match and your prize goes straight to your wallet." }, ].map(({ step, desc }, index) => (

{index + 1}. {step}

{desc}

))}
); }