diff --git a/app/(home)/student-launchpad/page.tsx b/app/(home)/student-launchpad/page.tsx new file mode 100644 index 00000000000..1aad0f85ec6 --- /dev/null +++ b/app/(home)/student-launchpad/page.tsx @@ -0,0 +1,135 @@ +'use client' +import Image from 'next/image' +import { Button } from "@/components/ui/button" +import { ArrowRight } from 'lucide-react' +import { useTheme } from 'next-themes' +import Link from 'next/link' +import { useState, useEffect } from 'react' +import { useSession } from 'next-auth/react' +import { useRouter } from 'next/navigation' + +export default function StudentLaunchpadPage() { + const { resolvedTheme } = useTheme() + const arrowColor = resolvedTheme === "dark" ? "white" : "black" + const [iframeLoaded, setIframeLoaded] = useState(false) + const { data: session, status } = useSession() + const router = useRouter() + + const handleIframeLoad = () => { + setIframeLoaded(true) + } + + // Redirect to login if not authenticated + useEffect(() => { + if (status === 'unauthenticated') { + const currentUrl = window.location.href + const loginUrl = `/login?callbackUrl=${encodeURIComponent(currentUrl)}` + router.push(loginUrl) + } + }, [status, router]) + + // Show loading state while checking authentication + if (status === 'loading') { + return ( +
+
+
+ ) + } + + // Don't render the form if not authenticated (will redirect) + if (status === 'unauthenticated') { + return null + } + + return ( +
+
+
+
+ Avalanche Logo + Avalanche Logo +
+

+ Student + + Launchpad + +

+

+ Get access to resources for your university or club, from guest speakers to teaching materials and funding for your event. +

+
+ +
+
+
+ {!iframeLoaded && ( +
+
+
+ )} + +
+