Skip to content

Commit a9b5ba3

Browse files
dcl10claude
andcommitted
Add landing page with auth-aware routing and placeholder pages
Landing page greets unauthenticated visitors and redirects signed-in users to /dashboard. Sign in and sign up buttons route to placeholder pages. Dashboard page guards its route and redirects unauthenticated users back to /. Closes #42 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d98b17b commit a9b5ba3

4 files changed

Lines changed: 93 additions & 26 deletions

File tree

frontend/app/dashboard/page.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { redirect } from "next/navigation";
2+
3+
import { getSession } from "@/lib/auth";
4+
5+
export default async function DashboardPage() {
6+
const session = await getSession();
7+
if (!session) redirect("/");
8+
9+
return (
10+
<main className="flex flex-col items-center justify-center min-h-screen bg-paper px-6 text-center">
11+
<h1 className="text-3xl font-bold tracking-[-0.025em] text-ink mb-3">
12+
Your project dashboard
13+
</h1>
14+
<p className="text-[15px] text-ink-soft">
15+
Dashboard functionality coming soon.
16+
</p>
17+
</main>
18+
);
19+
}

frontend/app/page.tsx

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
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";
36

47
export default async function HomePage() {
5-
const session = await getSession()
8+
const session = await getSession();
9+
if (session) redirect("/dashboard");
610

711
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+
);
3139
}

frontend/app/sign-in/page.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Link from "next/link";
2+
3+
export default function SignInPage() {
4+
return (
5+
<main className="flex flex-col items-center justify-center min-h-screen bg-paper px-6 text-center">
6+
<h1 className="text-3xl font-bold tracking-[-0.025em] text-ink mb-3">
7+
Sign in
8+
</h1>
9+
<p className="text-[15px] text-ink-soft mb-8">
10+
Sign-in functionality coming soon.
11+
</p>
12+
<Link
13+
href="/"
14+
className="text-[14px] font-medium text-nottingham-blue hover:underline"
15+
>
16+
Back to home
17+
</Link>
18+
</main>
19+
);
20+
}

frontend/app/sign-up/page.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Link from "next/link";
2+
3+
export default function SignUpPage() {
4+
return (
5+
<main className="flex flex-col items-center justify-center min-h-screen bg-paper px-6 text-center">
6+
<h1 className="text-3xl font-bold tracking-[-0.025em] text-ink mb-3">
7+
Sign up
8+
</h1>
9+
<p className="text-[15px] text-ink-soft mb-8">
10+
Sign-up functionality coming soon.
11+
</p>
12+
<Link
13+
href="/"
14+
className="text-[14px] font-medium text-nottingham-blue hover:underline"
15+
>
16+
Back to home
17+
</Link>
18+
</main>
19+
);
20+
}

0 commit comments

Comments
 (0)