Skip to content

Commit 94dfd82

Browse files
committed
feat: add onboarding landing page
1 parent a78abf3 commit 94dfd82

13 files changed

Lines changed: 2697 additions & 907 deletions

File tree

983 KB
Loading
338 KB
Loading

src/app/login/page.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ const getSafeNextUrl = (raw: string | null): string => {
2424

2525
try {
2626
const decoded = decodeURIComponent(raw)
27-
if (decoded.startsWith('/')) return decoded
27+
if (decoded.startsWith('/') && !decoded.startsWith('//')) return decoded
2828

2929
if (typeof window !== 'undefined') {
3030
const parsed = new URL(decoded, window.location.origin)
3131
if (parsed.origin === window.location.origin) {
3232
const nextPath = `${parsed.pathname}${parsed.search}${parsed.hash}`
33-
return nextPath.startsWith('/') ? nextPath : DEFAULT_FALLBACK_ROUTE
33+
return nextPath.startsWith('/') && !nextPath.startsWith('//')
34+
? nextPath
35+
: DEFAULT_FALLBACK_ROUTE
3436
}
3537
}
3638

@@ -426,12 +428,8 @@ export default function LoginPage() {
426428
<>
427429
<Loader isLoading={loading} />
428430
<div className="min-h-screen bg-[#1e1e1e] text-white">
429-
<div className="hidden pc:block">
430-
{renderPcView()}
431-
</div>
432-
<div className="block pc:hidden">
433-
{renderMobileView()}
434-
</div>
431+
<div className="hidden pc:block">{renderPcView()}</div>
432+
<div className="block pc:hidden">{renderMobileView()}</div>
435433
</div>
436434
</>
437435
)

src/app/onboarding/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import OnboardingLanding from '@/components/landing/OnboardingLanding'
2+
3+
export default function OnboardingPage() {
4+
return <OnboardingLanding />
5+
}

src/app/page.tsx

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,15 @@
33
import { useEffect } from 'react'
44
import { useRouter } from 'next/navigation'
55

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'
197

208
export default function Home() {
219
const router = useRouter()
10+
const { user } = useAuth()
2211

2312
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])
4315

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" />
5417
}

0 commit comments

Comments
 (0)