-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<nav className="fixed left-0 right-0 top-0 z-50 w-full bg-background bg-opacity-40 bg-clip-padding py-5 backdrop-blur-xl backdrop-filter lg:z-40 container max-w-screen-xl flex justify-between items-center"> | ||
<div className="space-x-2 flex items-center"> | ||
<Link href="/" aria-label="logo"> | ||
<span className="font-semibold text-foreground">umamin</span> | ||
<span className="text-muted-foreground font-medium">.link</span> | ||
</Link> | ||
|
||
<Badge variant="outline">partners</Badge> | ||
</div> | ||
|
||
<SignOutButton /> | ||
</nav> | ||
); | ||
} |
21 changes: 21 additions & 0 deletions
21
apps/partners/src/app/dashboard/components/sign-out-btn.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<Button | ||
data-testid="logout-btn" | ||
type="submit" | ||
disabled={pending} | ||
variant="outline" | ||
> | ||
{pending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />} | ||
Sign Out | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Navbar } from "./components/navbar"; | ||
|
||
export default function Layout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return ( | ||
<main> | ||
<Navbar /> | ||
{children} | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getSession } from "@/lib/auth"; | ||
|
||
export default async function Dashboard() { | ||
const { user } = await getSession(); | ||
return ( | ||
<div className="max-w-screen-xl mx-auto mt-32 container"> | ||
<h1 className="text-4xl">Hello, {user?.displayName || user?.username}</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters