"use client"; import { useRef, useState } from "react"; import { LandingHero } from "./landing/LandingHero"; import { AssetStats } from "./landing/AssetStats"; import { TopicEbookShowcase } from "./landing/TopicEbookShowcase"; import { CompareSection } from "./landing/CompareSection"; import { CommunityPreview } from "./landing/CommunityPreview"; import { FAQSection } from "./landing/FAQSection"; import { LandingCTA } from "./landing/LandingCTA"; import { LoginModal } from "./landing/LoginModal"; import { PromoProofModal } from "./landing/PromoProofModal"; import styles from "./vip.module.css"; type LandingPageProps = { onJoin: () => void; onVerify: (userId: string) => Promise; onVerifyByEmail?: ( email: string, password: string, user_id?: string ) => Promise; onVerifySuccess: () => void; }; export function LandingPage({ onJoin, onVerify, onVerifyByEmail, onVerifySuccess, }: LandingPageProps) { const [loginModalOpen, setLoginModalOpen] = useState(false); const [promoModalOpen, setPromoModalOpen] = useState(false); const [payTestMode, setPayTestMode] = useState(() => { if (typeof window === "undefined") return false; return localStorage.getItem("vipPayTestMode") === "1"; }); const titleTapCountRef = useRef(0); const handleHeroTitleTap = () => { titleTapCountRef.current += 1; if (titleTapCountRef.current < 10) return; titleTapCountRef.current = 0; const nextMode = !payTestMode; setPayTestMode(nextMode); if (typeof window !== "undefined") { localStorage.setItem("vipPayTestMode", nextMode ? "1" : "0"); } }; return ( <>
setLoginModalOpen(true)} />
setLoginModalOpen(true)} payTestMode={payTestMode} />
setLoginModalOpen(false)} onVerify={onVerify} onVerifyByEmail={onVerifyByEmail} onSuccess={onVerifySuccess} /> setPromoModalOpen(false)} /> ); }