import React, { useState, useEffect } from "react"; import { X } from "lucide-react"; import { FaDiscord, FaTelegram } from "react-icons/fa"; const DiscordPopup = () => { const [isVisible, setIsVisible] = useState(false); const [shouldRender, setShouldRender] = useState(false); useEffect(() => { // Check if the user has opted out of seeing the popup const isHidden = localStorage.getItem("hideDiscordPopup"); if (isHidden) return; // Set a timer for 2 minutes (120,000 ms) const timer = setTimeout(() => { setShouldRender(true); // Brief delay to trigger entrance animation setTimeout(() => setIsVisible(true), 10); }, 60000); return () => clearTimeout(timer); }, []); const handleClose = () => { setIsVisible(false); // Wait for animation to finish before removing from DOM setTimeout(() => setShouldRender(false), 300); }; const handleNeverShowAgain = () => { localStorage.setItem("hideDiscordPopup", "true"); handleClose(); }; if (!shouldRender) return null; return (
{/* Header */}
Join Our Community Discord & Telegram
{/* Content */}

Join our official channels for early updates, announcements, and to connect with other fans!

JOIN DISCORD JOIN TELEGRAM
); }; export default DiscordPopup;