|
| 1 | + |
1 | 2 | import React from 'react'; |
2 | | -import StarBackground from '@/components/StarBackground'; |
3 | | -import Header from '@/components/Header'; |
4 | | -import Hero from '@/components/Hero'; |
5 | | -import ExploreSpacesSection from '@/components/ExploreSpacesSection'; |
6 | | -import EcosystemSection from '@/components/EcosystemSection'; |
7 | | -import FeaturesSection from '@/components/FeaturesSection'; |
8 | | -import FinancialFreedomSection from '@/components/FinancialFreedomSection'; |
9 | | -import ParticipationSection from '@/components/ParticipationSection'; |
10 | | -import Footer from '@/components/Footer'; |
11 | | -import Logo from '@/components/Header/Logo'; |
| 3 | +import { AnimatePresence } from "framer-motion"; |
| 4 | +import { Menu, X } from "lucide-react"; |
| 5 | +import { useIsMobile } from "@/hooks/use-mobile"; |
| 6 | +import { useScroll } from "@/hooks/use-scroll"; |
| 7 | +import Logo from "@/components/Header/Logo"; |
| 8 | +import DesktopNav from "@/components/Header/DesktopNav"; |
| 9 | +import MobileNav from "@/components/Header/MobileNav"; |
| 10 | +import ConnectButton from "@/components/Header/ConnectButton"; |
| 11 | +import PriceTicker from "@/components/PriceTicker"; |
| 12 | + |
| 13 | +const Header = () => { |
| 14 | + const isScrolled = useScroll(); |
| 15 | + const [isMenuOpen, setIsMenuOpen] = React.useState(false); |
| 16 | + const isMobile = useIsMobile(); |
| 17 | + |
| 18 | + if (isMobile === undefined) { |
| 19 | + return <div className="bg-alien-space-dark h-16 w-full flex items-center justify-center">Cargando...</div>; |
| 20 | + } |
12 | 21 |
|
13 | | -const Index: React.FC = () => { |
14 | | - return <div className="min-h-screen bg-alien-space"> |
15 | | - <div className="fixed inset-0 z-0" style={{ |
16 | | - backgroundImage: `url('/lovable-uploads/EMWBack.png')`, |
17 | | - backgroundSize: 'cover', |
18 | | - backgroundPosition: 'center', |
19 | | - backgroundRepeat: 'no-repeat', |
20 | | - opacity: 0.3 |
21 | | - }}></div> |
22 | | - <StarBackground /> |
23 | | - <Header /> |
24 | | - <main className="relative z-10 pt-16"> |
25 | | - <Hero /> |
26 | | - <div className="container mx-auto text-center px-0 py-0"> |
27 | | - <h2 className="text-4xl md:text-5xl font-bold mb-4 text-alien-gold font-[Atomic Age]">₿£€$$</h2> |
28 | | - |
| 22 | + return ( |
| 23 | + <header |
| 24 | + className={`fixed top-0 left-0 w-full z-50 transition-all duration-300 ${ |
| 25 | + isScrolled ? "py-3 bg-alien-space-dark/90 backdrop-blur-lg shadow-md" : "py-6 bg-transparent" |
| 26 | + }`} |
| 27 | + > |
| 28 | + <div className="container mx-auto px-4 flex justify-between items-center relative"> |
| 29 | + <Logo /> |
| 30 | + <DesktopNav /> |
| 31 | + <div className="flex items-center gap-4"> |
| 32 | + {!isMobile && <ConnectButton />} |
| 33 | + {isMobile && ( |
| 34 | + <button |
| 35 | + onClick={() => setIsMenuOpen(!isMenuOpen)} |
| 36 | + className="p-2 text-alien-gold focus:outline-none focus:ring-2 focus:ring-alien-gold" |
| 37 | + aria-label={isMenuOpen ? "Cerrar menú de navegación" : "Abrir menú de navegación"} |
| 38 | + aria-expanded={isMenuOpen} |
| 39 | + aria-controls="mobile-menu" |
| 40 | + data-state={isMenuOpen ? "open" : "closed"} |
| 41 | + > |
| 42 | + {isMenuOpen ? <X size={24} /> : <Menu size={24} />} |
| 43 | + </button> |
| 44 | + )} |
29 | 45 | </div> |
30 | | - <FinancialFreedomSection /> |
31 | | - <ExploreSpacesSection /> |
32 | | - <EcosystemSection /> |
33 | | - <FeaturesSection /> |
34 | | - <ParticipationSection /> |
35 | | - </main> |
36 | | - <Footer /> |
37 | | - </div>; |
| 46 | + </div> |
| 47 | + <AnimatePresence> |
| 48 | + {isMobile && isMenuOpen && ( |
| 49 | + <MobileNav isMenuOpen={isMenuOpen} setIsMenuOpen={setIsMenuOpen} /> |
| 50 | + )} |
| 51 | + </AnimatePresence> |
| 52 | + <div className="absolute left-0 right-0 bottom-0 translate-y-full w-full bg-alien-space-dark/80"> |
| 53 | + <PriceTicker /> |
| 54 | + </div> |
| 55 | + </header> |
| 56 | + ); |
38 | 57 | }; |
39 | 58 |
|
40 | | -export default Index; |
| 59 | +export default Header; |
0 commit comments