|
1 | | -import { SignInButton, SignOutButton } from '@/lib/auth/components/auth-buttons' |
2 | | -import { getSession } from '@/lib/auth' |
| 1 | +import Link from "next/link"; |
| 2 | +import { redirect } from "next/navigation"; |
| 3 | + |
| 4 | +import { LandingTopBar } from "@/components/shared"; |
| 5 | +import { getSession } from "@/lib/auth"; |
3 | 6 |
|
4 | 7 | export default async function HomePage() { |
5 | | - const session = await getSession() |
| 8 | + const session = await getSession(); |
| 9 | + if (session) redirect("/dashboard"); |
6 | 10 |
|
7 | 11 | return ( |
8 | | - <main style={{ fontFamily: 'sans-serif', maxWidth: 640, margin: '4rem auto', padding: '0 1rem' }}> |
9 | | - <h1>SkillMatrixLlm</h1> |
10 | | - |
11 | | - {session ? ( |
12 | | - <> |
13 | | - <p> |
14 | | - Signed in as <strong>{session.user?.email ?? session.user?.name}</strong> |
15 | | - </p> |
16 | | - {session.error === 'RefreshAccessTokenError' && ( |
17 | | - <p style={{ color: 'red' }}> |
18 | | - Your session has expired. Please sign in again. |
19 | | - </p> |
20 | | - )} |
21 | | - <SignOutButton /> |
22 | | - </> |
23 | | - ) : ( |
24 | | - <> |
25 | | - <p>You are not signed in.</p> |
26 | | - <SignInButton /> |
27 | | - </> |
28 | | - )} |
29 | | - </main> |
30 | | - ) |
| 12 | + <> |
| 13 | + <LandingTopBar /> |
| 14 | + <main className="flex flex-col items-center justify-center min-h-[calc(100vh-60px)] bg-paper px-6 text-center"> |
| 15 | + <h1 className="text-5xl font-bold tracking-[-0.03em] text-ink mb-4"> |
| 16 | + Welcome to Matchboard |
| 17 | + </h1> |
| 18 | + <p className="text-[17px] text-ink-soft max-w-[520px] mb-10"> |
| 19 | + The Digital Research Service skills-matching platform. Connect |
| 20 | + researchers with the expertise your project needs. |
| 21 | + </p> |
| 22 | + <div className="flex items-center gap-3"> |
| 23 | + <Link |
| 24 | + href="/sign-in" |
| 25 | + className="inline-flex items-center gap-2 font-sans font-medium tracking-[-0.005em] rounded-sm px-[16px] py-[9px] text-[14px] bg-paper text-ink border border-[var(--border-strong)] hover:bg-portland-stone transition-colors duration-[120ms]" |
| 26 | + > |
| 27 | + Sign in |
| 28 | + </Link> |
| 29 | + <Link |
| 30 | + href="/sign-up" |
| 31 | + className="inline-flex items-center gap-2 font-sans font-medium tracking-[-0.005em] rounded-sm px-[16px] py-[9px] text-[14px] bg-nottingham-blue text-paper border border-nottingham-blue hover:bg-[var(--color-primary-deep)] transition-colors duration-[120ms]" |
| 32 | + > |
| 33 | + Sign up |
| 34 | + </Link> |
| 35 | + </div> |
| 36 | + </main> |
| 37 | + </> |
| 38 | + ); |
31 | 39 | } |
0 commit comments