Skip to content

Commit 3603123

Browse files
authored
Update Index.tsx
Signed-off-by: Aitor Alien <[email protected]>
1 parent 800c032 commit 3603123

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

src/pages/Index.tsx

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,49 @@
1+
import React, { Suspense, lazy } from 'react';
2+
import StarBackground from '@/components/StarBackground';
13

2-
import React from 'react';
3-
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';
4+
// Lazy loading de secciones
5+
const Hero = lazy(() => import('@/components/Hero'));
6+
const ExploreSpacesSection = lazy(() => import('@/components/ExploreSpacesSection'));
7+
const EcosystemSection = lazy(() => import('@/components/EcosystemSection'));
8+
const FeaturesSection = lazy(() => import('@/components/FeaturesSection'));
9+
const FinancialFreedomSection = lazy(() => import('@/components/FinancialFreedomSection'));
10+
const ParticipationSection = lazy(() => import('@/components/ParticipationSection'));
1011

1112
const Index: React.FC = () => {
1213
return (
1314
<div className="relative z-10 min-h-screen">
14-
<Hero />
15-
<FinancialFreedomSection />
16-
<ExploreSpacesSection />
17-
<EcosystemSection />
18-
<FeaturesSection />
19-
<div className="section-center">
20-
<ParticipationSection />
15+
{/* Hero con efecto Star Wars + estrellas */}
16+
<div className="relative">
17+
<div className="absolute inset-0 -z-10">
18+
<StarBackground />
19+
</div>
20+
<Suspense fallback={<div className="h-[80vh] flex items-center justify-center">Loading...</div>}>
21+
<Hero />
22+
</Suspense>
2123
</div>
24+
25+
{/* Secciones con lazy loading */}
26+
<Suspense fallback={<div className="h-40 flex items-center justify-center">Loading section...</div>}>
27+
<FinancialFreedomSection />
28+
</Suspense>
29+
30+
<Suspense fallback={<div className="h-40 flex items-center justify-center">Loading section...</div>}>
31+
<ExploreSpacesSection />
32+
</Suspense>
33+
34+
<Suspense fallback={<div className="h-40 flex items-center justify-center">Loading section...</div>}>
35+
<EcosystemSection />
36+
</Suspense>
37+
38+
<Suspense fallback={<div className="h-40 flex items-center justify-center">Loading section...</div>}>
39+
<FeaturesSection />
40+
</Suspense>
41+
42+
<Suspense fallback={<div className="h-40 flex items-center justify-center">Loading section...</div>}>
43+
<div className="section-center">
44+
<ParticipationSection />
45+
</div>
46+
</Suspense>
2247
</div>
2348
);
2449
};

0 commit comments

Comments
 (0)