-
Notifications
You must be signed in to change notification settings - Fork 427
/
navbar.tsx
54 lines (51 loc) · 1.66 KB
/
navbar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use client";
import Image from "next/image";
import Link from "next/link";
import useScroll from "@/lib/hooks/use-scroll";
import { SignedIn, SignedOut, SignInButton, UserButton } from "@clerk/nextjs";
import { LayoutDashboard } from "lucide-react";
export default function NavBar() {
const scrolled = useScroll(50);
return (
<>
<div
className={`fixed top-0 flex w-full justify-center ${
scrolled
? "border-b border-gray-200 bg-white/50 backdrop-blur-xl"
: "bg-white/0"
} z-30 transition-all`}
>
<div className="mx-5 flex h-16 w-full max-w-screen-xl items-center justify-between">
<Link href="/" className="flex items-center font-display text-2xl">
<Image
src="/logo.png"
alt="Precedent logo"
width="30"
height="30"
className="mr-2 rounded-sm"
></Image>
<p>Precedent</p>
</Link>
<SignedOut>
<SignInButton mode="modal">
<button className="rounded-full border border-black bg-black px-4 py-1.5 text-sm text-white transition-colors hover:bg-white hover:text-black">
Sign In
</button>
</SignInButton>
</SignedOut>
<SignedIn>
<UserButton>
<UserButton.MenuItems>
<UserButton.Link
label="Dashboard"
labelIcon={<LayoutDashboard className="h-4 w-4" />}
href="/"
/>
</UserButton.MenuItems>
</UserButton>
</SignedIn>
</div>
</div>
</>
);
}