Skip to content

Commit 225ab05

Browse files
committed
Handle 'Get Started' Button
1 parent 520d96b commit 225ab05

3 files changed

Lines changed: 44 additions & 3 deletions

File tree

src/app/(home)/page.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import { auth } from "@clerk/nextjs/server";
12
import { Cloud, Shield, Users, Zap } from "lucide-react";
23
import Link from "next/link";
4+
import { redirect } from "next/navigation";
5+
36
import { Button } from "~/components/ui/button";
47

58
export default function HomePage() {
@@ -49,14 +52,23 @@ export default function HomePage() {
4952
documents from any device, anywhere in the world.
5053
</p>
5154

52-
<div className="pt-8">
55+
<form
56+
className="pt-8"
57+
action={async () => {
58+
"use server";
59+
const session = await auth();
60+
if (!session.userId) return redirect("/sign-in");
61+
redirect("/drive");
62+
}}
63+
>
5364
<Button
5465
size="lg"
55-
className="rounded-full bg-white px-8 py-6 text-lg font-semibold text-black transition-all duration-200 hover:scale-105 hover:bg-gray-100"
66+
className="cursor-pointer rounded-full bg-white px-8 py-6 text-lg font-semibold text-black transition-all duration-200 hover:scale-105 hover:bg-gray-100"
67+
type="submit"
5668
>
5769
Get Started
5870
</Button>
59-
</div>
71+
</form>
6072

6173
<p className="pt-4 text-sm text-gray-400">
6274
Free 15GB storage • No credit card required

src/app/drive/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function DrivePage() {
2+
return <div />;
3+
}

src/app/sign-in/page.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { SignInButton } from "@clerk/nextjs";
2+
3+
export default function HomePage() {
4+
return (
5+
<div className="min-h-screen bg-gradient-to-br from-black via-gray-900 to-gray-800 text-white">
6+
<main className="mx-auto flex max-w-4xl flex-col items-center justify-center px-6 py-20 text-center">
7+
<div className="space-y-8">
8+
<h1 className="text-5xl font-bold tracking-tight md:text-7xl">
9+
Your files,
10+
<br />
11+
<span className="bg-gradient-to-r from-gray-400 to-gray-200 bg-clip-text text-transparent">
12+
everywhere
13+
</span>
14+
</h1>
15+
16+
<p className="mx-auto max-w-2xl text-xl leading-relaxed text-gray-300 md:text-2xl">
17+
Store, sync, and share your files with T4S Drive. Access your
18+
documents from any device, anywhere in the world.
19+
</p>
20+
21+
<SignInButton />
22+
</div>
23+
</main>
24+
</div>
25+
);
26+
}

0 commit comments

Comments
 (0)