|
3 | 3 | import { useEffect } from 'react' |
4 | 4 | import { useRouter } from 'next/navigation' |
5 | 5 |
|
6 | | -import Lenis from '@studio-freight/lenis' |
7 | | - |
8 | | -import gsap from 'gsap' |
9 | | -import ScrollTrigger from 'gsap/ScrollTrigger' |
10 | | - |
11 | | -import HeroSection from '@/components/landing/HeroSection' |
12 | | -import AboutSection from '@/components/landing/AboutSection' |
13 | | -import StatsSection from '@/components/landing/StatsSection' |
14 | | -import ActivitiesSection from '@/components/landing/ActivitiesSection' |
15 | | -import PartnersSection from '@/components/landing/PartnersSection' |
16 | | -import CTASection from '@/components/landing/CTASection' |
17 | | - |
18 | | -gsap.registerPlugin(ScrollTrigger) |
| 6 | +import { useAuth } from '@/hooks/useAuth' |
19 | 7 |
|
20 | 8 | export default function Home() { |
21 | 9 | const router = useRouter() |
| 10 | + const { user } = useAuth() |
22 | 11 |
|
23 | 12 | useEffect(() => { |
24 | | - const lenis = new Lenis({ |
25 | | - duration: 1.5, |
26 | | - smoothWheel: true, |
27 | | - wheelMultiplier: 0.8 |
28 | | - }) |
29 | | - |
30 | | - const tickerHandler = (time: number) => { |
31 | | - lenis.raf(time * 800) |
32 | | - } |
33 | | - |
34 | | - gsap.ticker.add(tickerHandler) |
35 | | - |
36 | | - lenis.on('scroll', ScrollTrigger.update) |
37 | | - |
38 | | - return () => { |
39 | | - lenis.destroy() |
40 | | - gsap.ticker.remove(tickerHandler) |
41 | | - } |
42 | | - }, []) |
| 13 | + router.replace(user ? '/' : '/onboarding') |
| 14 | + }, [router, user]) |
43 | 15 |
|
44 | | - return ( |
45 | | - <div className="flex flex-col w-screen"> |
46 | | - <HeroSection router={router} /> |
47 | | - <AboutSection /> |
48 | | - <StatsSection /> |
49 | | - <ActivitiesSection /> |
50 | | - <PartnersSection /> |
51 | | - <CTASection router={router} /> |
52 | | - </div> |
53 | | - ) |
| 16 | + return <main className="min-h-screen bg-black" /> |
54 | 17 | } |
0 commit comments