Skip to content

Commit 405bfeb

Browse files
committed
Dashboard theming and added background image
1 parent b3801e5 commit 405bfeb

File tree

2 files changed

+50
-22
lines changed

2 files changed

+50
-22
lines changed

public/dashboard.png

1.61 MB
Loading

src/app/dashboard/page.tsx

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { redirect } from "next/navigation";
22
import Link from "next/link";
33
import { createClient as createServerClient } from "../../lib/supabase/server";
4+
import { Cinzel } from 'next/font/google'; // Import Cinzel font
5+
6+
//font for words
7+
const cinzel = Cinzel({
8+
subsets: ["latin"],
9+
weight: ["400", "700"],
10+
});
411

512
async function logout() {
613
"use server";
@@ -19,30 +26,51 @@ export default async function DashboardPage() {
1926
redirect("/login");
2027
}
2128

29+
const celestialButtonClasses = "btn border-2 border-cyan-400 text-cyan-400 bg-transparent hover:bg-cyan-900/50 hover:border-cyan-200 hover:text-cyan-200 shadow-lg shadow-cyan-500/50 transition duration-300 ease-in-out w-full";
30+
const celestialButtonNoFullWidth = "btn border-2 border-cyan-400 text-cyan-400 bg-transparent hover:bg-cyan-900/50 hover:border-cyan-200 hover:text-cyan-200 shadow-lg shadow-cyan-500/50 transition duration-300 ease-in-out";
31+
32+
2233
return (
23-
<main className="bg-white min-h-dvh p-8">
24-
<div className="flex items-center gap-4">
25-
<h1 className="text-black text-2xl font-semibold">Dashboard</h1>
26-
<Link href="/" className="btn btn-neutral btn-outline" aria-label="Go home">
27-
<span>Home</span>
28-
</Link>
29-
<Link href="/profile" className="btn btn-neutral btn-outline" aria-label="Go to profile">
30-
<span>Profile</span>
31-
</Link>
32-
<form action={logout}>
33-
<button type="submit" className="btn btn-neutral btn-outline">
34-
<span>Log out</span>
35-
</button>
36-
</form>
37-
</div>
34+
<main
35+
className={`relative min-h-dvh p-8 text-white ${cinzel.className}`}
36+
style={{
37+
backgroundImage: "url('/dashboard.png')",
38+
backgroundSize: 'cover',
39+
backgroundPosition: 'center',
40+
}}
41+
>
42+
<div className="flex justify-between items-start w-full">
43+
44+
<div className="flex flex-col gap-4 p-0 w-fit">
45+
<h1 className="text-white text-5xl font-bold tracking-wider mb-4">
46+
Dashboard
47+
</h1>
48+
<div className="flex flex-col gap-4 w-32">
49+
<Link href="/" className={celestialButtonClasses} aria-label="Go home">
50+
<span>Home</span>
51+
</Link>
52+
</div>
53+
</div>
3854

39-
<p className="my-4 text-neutral-600">
40-
You&apos;re logged in as: <span className="font-bold">{user.email}</span>.
41-
</p>
55+
{/* profile & logout */}
56+
<div className="flex items-center gap-4 p-0 w-fit">
57+
<Link href="/profile" className={celestialButtonNoFullWidth} aria-label="Go to profile">
58+
<span>Profile</span>
59+
</Link>
60+
<form action={logout}>
61+
<button type="submit" className={celestialButtonNoFullWidth}>
62+
<span>Log out</span>
63+
</button>
64+
</form>
65+
</div>
66+
</div>
4267

43-
<Link href="tutorial-hello-world" className="btn btn-neutral btn-outline">
44-
Hello World Tutorial
45-
</Link>
68+
{/* tutorials */}
69+
<div className="absolute bottom-16 left-1/2 -translate-x-1/2">
70+
<Link href="tutorial-hello-world" className={celestialButtonNoFullWidth}>
71+
Hello World
72+
</Link>
73+
</div>
4674
</main>
4775
);
48-
}
76+
}

0 commit comments

Comments
 (0)