Skip to content

Commit 1e49db9

Browse files
committed
Better Folder Structure
1 parent 4c0883c commit 1e49db9

File tree

5 files changed

+168
-177
lines changed

5 files changed

+168
-177
lines changed

src/app/drive/page.tsx renamed to src/app/(home)/drive/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { auth } from "@clerk/nextjs/server";
22
import { redirect } from "next/navigation";
33

44
import { Button } from "~/components/ui/button";
5-
import * as queries from "~/server/db/queries";
65
import * as mutations from "~/server/db/mutations";
6+
import * as queries from "~/server/db/queries";
77

88
export default async function DrivePage() {
99
const session = await auth();
@@ -20,7 +20,13 @@ export default async function DrivePage() {
2020
return redirect(`/f/${rootFolderId}`);
2121
}}
2222
>
23-
<Button>Create Folder</Button>
23+
<Button
24+
size="lg"
25+
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"
26+
type="submit"
27+
>
28+
Create Your Drive
29+
</Button>
2430
</form>
2531
);
2632
}

src/app/(home)/layout.tsx

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import { Cloud, Shield, Users, Zap } from "lucide-react";
2+
import Link from "next/link";
3+
4+
export default function HomePage({ children }: { children: React.ReactNode }) {
5+
return (
6+
<div className="min-h-screen bg-gradient-to-br from-black via-gray-900 to-gray-800 text-white">
7+
{/* Navigation */}
8+
<nav className="mx-auto flex max-w-7xl items-center justify-between p-6">
9+
<div className="flex items-center space-x-2">
10+
<Cloud className="h-8 w-8 text-white" />
11+
<span className="text-2xl font-bold">T4S Drive</span>
12+
</div>
13+
<div className="hidden items-center space-x-8 md:flex">
14+
<Link
15+
href="#features"
16+
className="text-gray-300 transition-colors hover:text-white"
17+
>
18+
Features
19+
</Link>
20+
<Link
21+
href="#pricing"
22+
className="text-gray-300 transition-colors hover:text-white"
23+
>
24+
Pricing
25+
</Link>
26+
<Link
27+
href="#contact"
28+
className="text-gray-300 transition-colors hover:text-white"
29+
>
30+
Contact
31+
</Link>
32+
</div>
33+
</nav>
34+
35+
{/* Hero Section */}
36+
<main className="mx-auto flex max-w-4xl flex-col items-center justify-center px-6 py-20 text-center">
37+
<div className="space-y-8">
38+
<h1 className="text-5xl font-bold tracking-tight md:text-7xl">
39+
Your files,
40+
<br />
41+
<span className="bg-gradient-to-r from-gray-400 to-gray-200 bg-clip-text text-transparent">
42+
everywhere
43+
</span>
44+
</h1>
45+
46+
<p className="mx-auto max-w-2xl text-xl leading-relaxed text-gray-300 md:text-2xl">
47+
Store, sync, and share your files with T4S Drive. Access your
48+
documents from any device, anywhere in the world.
49+
</p>
50+
51+
{children}
52+
53+
<p className="pt-4 text-sm text-gray-400">
54+
Free 15GB storage • No credit card required
55+
</p>
56+
</div>
57+
</main>
58+
59+
{/* Features Section */}
60+
<section className="mx-auto max-w-6xl px-6 py-20">
61+
<div className="grid gap-8 md:grid-cols-3">
62+
<div className="space-y-4 text-center">
63+
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
64+
<Shield className="h-8 w-8 text-gray-300" />
65+
</div>
66+
<h3 className="text-xl font-semibold">Secure Storage</h3>
67+
<p className="text-gray-400">
68+
Your files are encrypted and protected with enterprise-grade
69+
security.
70+
</p>
71+
</div>
72+
73+
<div className="space-y-4 text-center">
74+
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
75+
<Zap className="h-8 w-8 text-gray-300" />
76+
</div>
77+
<h3 className="text-xl font-semibold">Lightning Fast</h3>
78+
<p className="text-gray-400">
79+
Upload and download files at blazing speeds with our global CDN.
80+
</p>
81+
</div>
82+
83+
<div className="space-y-4 text-center">
84+
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
85+
<Users className="h-8 w-8 text-gray-300" />
86+
</div>
87+
<h3 className="text-xl font-semibold">Easy Sharing</h3>
88+
<p className="text-gray-400">
89+
Share files and folders with anyone, with granular permission
90+
controls.
91+
</p>
92+
</div>
93+
</div>
94+
</section>
95+
96+
{/* Footer */}
97+
<footer className="mt-20 border-t border-gray-800 px-6 py-8">
98+
<div className="mx-auto flex max-w-6xl flex-col items-center justify-between md:flex-row">
99+
<div className="mb-4 flex items-center space-x-2 md:mb-0">
100+
<Cloud className="h-6 w-6 text-gray-400" />
101+
<span className="text-gray-400">
102+
© 2024 T4S Drive. All rights reserved.
103+
</span>
104+
</div>
105+
<div className="flex space-x-6">
106+
<Link
107+
href="#"
108+
className="text-gray-400 transition-colors hover:text-white"
109+
>
110+
Privacy
111+
</Link>
112+
<Link
113+
href="#"
114+
className="text-gray-400 transition-colors hover:text-white"
115+
>
116+
Terms
117+
</Link>
118+
<Link
119+
href="#"
120+
className="text-gray-400 transition-colors hover:text-white"
121+
>
122+
Support
123+
</Link>
124+
</div>
125+
</div>
126+
</footer>
127+
</div>
128+
);
129+
}

src/app/(home)/page.tsx

Lines changed: 16 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,25 @@
11
import { auth } from "@clerk/nextjs/server";
2-
import { Cloud, Shield, Users, Zap } from "lucide-react";
3-
import Link from "next/link";
42
import { redirect } from "next/navigation";
53

64
import { Button } from "~/components/ui/button";
75

86
export default function HomePage() {
97
return (
10-
<div className="min-h-screen bg-gradient-to-br from-black via-gray-900 to-gray-800 text-white">
11-
{/* Navigation */}
12-
<nav className="mx-auto flex max-w-7xl items-center justify-between p-6">
13-
<div className="flex items-center space-x-2">
14-
<Cloud className="h-8 w-8 text-white" />
15-
<span className="text-2xl font-bold">T4S Drive</span>
16-
</div>
17-
<div className="hidden items-center space-x-8 md:flex">
18-
<Link
19-
href="#features"
20-
className="text-gray-300 transition-colors hover:text-white"
21-
>
22-
Features
23-
</Link>
24-
<Link
25-
href="#pricing"
26-
className="text-gray-300 transition-colors hover:text-white"
27-
>
28-
Pricing
29-
</Link>
30-
<Link
31-
href="#contact"
32-
className="text-gray-300 transition-colors hover:text-white"
33-
>
34-
Contact
35-
</Link>
36-
</div>
37-
</nav>
38-
39-
{/* Hero Section */}
40-
<main className="mx-auto flex max-w-4xl flex-col items-center justify-center px-6 py-20 text-center">
41-
<div className="space-y-8">
42-
<h1 className="text-5xl font-bold tracking-tight md:text-7xl">
43-
Your files,
44-
<br />
45-
<span className="bg-gradient-to-r from-gray-400 to-gray-200 bg-clip-text text-transparent">
46-
everywhere
47-
</span>
48-
</h1>
49-
50-
<p className="mx-auto max-w-2xl text-xl leading-relaxed text-gray-300 md:text-2xl">
51-
Store, sync, and share your files with T4S Drive. Access your
52-
documents from any device, anywhere in the world.
53-
</p>
54-
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-
>
64-
<Button
65-
size="lg"
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"
68-
>
69-
Get Started
70-
</Button>
71-
</form>
72-
73-
<p className="pt-4 text-sm text-gray-400">
74-
Free 15GB storage • No credit card required
75-
</p>
76-
</div>
77-
</main>
78-
79-
{/* Features Section */}
80-
<section className="mx-auto max-w-6xl px-6 py-20">
81-
<div className="grid gap-8 md:grid-cols-3">
82-
<div className="space-y-4 text-center">
83-
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
84-
<Shield className="h-8 w-8 text-gray-300" />
85-
</div>
86-
<h3 className="text-xl font-semibold">Secure Storage</h3>
87-
<p className="text-gray-400">
88-
Your files are encrypted and protected with enterprise-grade
89-
security.
90-
</p>
91-
</div>
92-
93-
<div className="space-y-4 text-center">
94-
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
95-
<Zap className="h-8 w-8 text-gray-300" />
96-
</div>
97-
<h3 className="text-xl font-semibold">Lightning Fast</h3>
98-
<p className="text-gray-400">
99-
Upload and download files at blazing speeds with our global CDN.
100-
</p>
101-
</div>
102-
103-
<div className="space-y-4 text-center">
104-
<div className="mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-gray-800">
105-
<Users className="h-8 w-8 text-gray-300" />
106-
</div>
107-
<h3 className="text-xl font-semibold">Easy Sharing</h3>
108-
<p className="text-gray-400">
109-
Share files and folders with anyone, with granular permission
110-
controls.
111-
</p>
112-
</div>
113-
</div>
114-
</section>
115-
116-
{/* Footer */}
117-
<footer className="mt-20 border-t border-gray-800 px-6 py-8">
118-
<div className="mx-auto flex max-w-6xl flex-col items-center justify-between md:flex-row">
119-
<div className="mb-4 flex items-center space-x-2 md:mb-0">
120-
<Cloud className="h-6 w-6 text-gray-400" />
121-
<span className="text-gray-400">
122-
© 2024 T4S Drive. All rights reserved.
123-
</span>
124-
</div>
125-
<div className="flex space-x-6">
126-
<Link
127-
href="#"
128-
className="text-gray-400 transition-colors hover:text-white"
129-
>
130-
Privacy
131-
</Link>
132-
<Link
133-
href="#"
134-
className="text-gray-400 transition-colors hover:text-white"
135-
>
136-
Terms
137-
</Link>
138-
<Link
139-
href="#"
140-
className="text-gray-400 transition-colors hover:text-white"
141-
>
142-
Support
143-
</Link>
144-
</div>
145-
</div>
146-
</footer>
147-
</div>
8+
<form
9+
action={async () => {
10+
"use server";
11+
const session = await auth();
12+
if (!session.userId) return redirect("/sign-in");
13+
redirect("/drive");
14+
}}
15+
>
16+
<Button
17+
size="lg"
18+
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"
19+
type="submit"
20+
>
21+
Get Started
22+
</Button>
23+
</form>
14824
);
14925
}

src/app/(home)/sign-in/page.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { SignInButton } from "@clerk/nextjs";
2+
3+
import { Button } from "~/components/ui/button";
4+
5+
export default function HomePage() {
6+
return (
7+
<Button
8+
size="lg"
9+
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"
10+
asChild
11+
>
12+
<SignInButton forceRedirectUrl="/drive" />
13+
</Button>
14+
);
15+
}

src/app/sign-in/page.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)