import { useState } from 'react' import { motion } from 'framer-motion' import { ArrowRight } from 'lucide-react' import HeaderBar from '../components/landing/HeaderBar' import HeroSection from '../components/landing/HeroSection' import AboutSection from '../components/landing/AboutSection' import FeaturesSection from '../components/landing/FeaturesSection' import HowItWorksSection from '../components/landing/HowItWorksSection' import CommunitySection from '../components/landing/CommunitySection' import AnimatedSection from '../components/landing/AnimatedSection' import LoginModal from '../components/landing/LoginModal' import FooterSection from '../components/landing/FooterSection' import { useAuth } from '../contexts/AuthContext' import { useLanguage } from '../contexts/LanguageContext' import { t } from '../i18n/translations' export function LandingPage() { const [showLoginModal, setShowLoginModal] = useState(false) const { user, logout } = useAuth() const { language, setLanguage } = useLanguage() const isLoggedIn = !!user console.log('LandingPage - user:', user, 'isLoggedIn:', isLoggedIn) return ( <> setShowLoginModal(true)} isLoggedIn={isLoggedIn} isHomePage={true} language={language} onLanguageChange={setLanguage} user={user} onLogout={logout} onPageChange={(page) => { console.log('LandingPage onPageChange called with:', page) if (page === 'competition') { window.location.href = '/competition' } else if (page === 'traders') { window.location.href = '/traders' } else if (page === 'trader') { window.location.href = '/dashboard' } }} />
{/* CTA */}
{t('readyToDefine', language)} {t('startWithCrypto', language)}
setShowLoginModal(true)} className="flex items-center gap-2 px-10 py-4 rounded-lg font-semibold text-lg" style={{ background: 'var(--brand-yellow)', color: 'var(--brand-black)', }} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} > {t('getStartedNow', language)} {t('viewSourceCode', language)}
{showLoginModal && ( setShowLoginModal(false)} language={language} /> )}
) }