-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavbar.tsx
52 lines (49 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
"use client";
import Image from "next/image";
import Link from "next/link";
import useScroll from "@/lib/hooks/use-scroll";
import { useSignInModal } from "./sign-in-modal";
import UserDropdown from "./user-dropdown";
import { Session } from "next-auth";
export default function NavBar({ session }: { session: Session | null }) {
const { SignInModal, setShowSignInModal } = useSignInModal();
const scrolled = useScroll(50);
return (
<>
<SignInModal />
<div
className={`fixed top-0 w-full flex 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 max-w-screen-xl items-center justify-between w-full">
<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><b>we think Agile Consulting</b></p>
<small> Being of Service around the Globe</small>
</Link>
<div>
{session ? (
<UserDropdown session={session} />
) : (
<button
className="rounded-full border border-black bg-black p-1.5 px-4 text-sm text-white transition-all hover:bg-white hover:text-black"
onClick={() => setShowSignInModal(true)}
>
Login
</button>
)}
</div>
</div>
</div>
</>
);
}