diff --git a/apps/partners/src/app/dashboard/components/navbar.tsx b/apps/partners/src/app/dashboard/components/navbar.tsx new file mode 100644 index 00000000..3dccf48e --- /dev/null +++ b/apps/partners/src/app/dashboard/components/navbar.tsx @@ -0,0 +1,20 @@ +import Link from "next/link"; +import { Badge } from "@umamin/ui/components/badge"; +import { SignOutButton } from "./sign-out-btn"; + +export async function Navbar() { + return ( + + ); +} diff --git a/apps/partners/src/app/dashboard/components/sign-out-btn.tsx b/apps/partners/src/app/dashboard/components/sign-out-btn.tsx new file mode 100644 index 00000000..d34486a3 --- /dev/null +++ b/apps/partners/src/app/dashboard/components/sign-out-btn.tsx @@ -0,0 +1,21 @@ +"use client"; + +import { Loader2 } from "lucide-react"; +import { useFormStatus } from "react-dom"; +import { Button } from "@umamin/ui/components/button"; + +export function SignOutButton() { + const { pending } = useFormStatus(); + + return ( + + ); +} diff --git a/apps/partners/src/app/dashboard/layout.tsx b/apps/partners/src/app/dashboard/layout.tsx new file mode 100644 index 00000000..ee6b22b9 --- /dev/null +++ b/apps/partners/src/app/dashboard/layout.tsx @@ -0,0 +1,14 @@ +import { Navbar } from "./components/navbar"; + +export default function Layout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( +
+ + {children} +
+ ); +} diff --git a/apps/partners/src/app/dashboard/page.tsx b/apps/partners/src/app/dashboard/page.tsx new file mode 100644 index 00000000..c8c14490 --- /dev/null +++ b/apps/partners/src/app/dashboard/page.tsx @@ -0,0 +1,10 @@ +import { getSession } from "@/lib/auth"; + +export default async function Dashboard() { + const { user } = await getSession(); + return ( +
+

Hello, {user?.displayName || user?.username}

+
+ ); +} diff --git a/apps/partners/src/app/login/page.tsx b/apps/partners/src/app/login/page.tsx index a8151281..b5759e10 100644 --- a/apps/partners/src/app/login/page.tsx +++ b/apps/partners/src/app/login/page.tsx @@ -41,7 +41,7 @@ export default async function Login() { const { user } = await getSession(); if (user) { - redirect("/inbox"); + redirect("/dashboard"); } return (