Skip to content

Commit 983f4e6

Browse files
Merge pull request #136 from devxtra-community/feat-ajay
feat:navbar dropdown
2 parents 5171b0a + d5fb8af commit 983f4e6

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

apps/web/components/Navbar.tsx

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import React, { useState, useEffect, useRef } from "react";
44
import Link from "next/link";
55
import Image from "next/image";
66
import { usePathname, useRouter } from "next/navigation";
7-
import {
8-
Menu,
9-
X,
10-
LogOut,
11-
LayoutDashboard,
7+
import {
8+
Menu,
9+
X,
10+
LogOut,
11+
LayoutDashboard,
1212
ChevronDown,
1313
User as UserIcon
1414
} from "lucide-react";
@@ -92,12 +92,11 @@ export default function Navbar() {
9292
const dashboardPath = user?.role === "INFLUENCER" ? "/influencer-dashboard" : "/brand-dashboard";
9393

9494
return (
95-
<motion.nav
95+
<motion.nav
9696
layout
9797
initial={false}
98-
className={`fixed top-6 left-1/2 -translate-x-1/2 w-[92%] sm:w-[95%] max-w-[1400px] z-50 bg-white/80 backdrop-blur-xl border border-white/40 shadow-[0_8px_32px_0_rgba(0,0,0,0.1)] transition-all duration-500 ${
99-
isMenuOpen ? "rounded-[32px] overflow-hidden" : "rounded-full overflow-visible"
100-
} ${isVisible ? "translate-y-0 opacity-100" : "-translate-y-32 opacity-0"}`}
98+
className={`fixed top-6 left-1/2 -translate-x-1/2 w-[92%] sm:w-[95%] max-w-[1400px] z-50 bg-white/80 backdrop-blur-xl border border-white/40 shadow-[0_8px_32px_0_rgba(0,0,0,0.1)] transition-all duration-500 ${isMenuOpen ? "rounded-[32px] overflow-hidden" : "rounded-full overflow-visible"
99+
} ${isVisible ? "translate-y-0 opacity-100" : "-translate-y-32 opacity-0"}`}
101100
transition={{
102101
type: "spring",
103102
stiffness: 400,
@@ -222,9 +221,9 @@ export default function Navbar() {
222221
</AnimatePresence>
223222
</div>
224223
)}
225-
224+
226225
{/* Mobile Menu Toggle */}
227-
<button
226+
<button
228227
onClick={() => setIsMenuOpen(!isMenuOpen)}
229228
className="lg:hidden w-10 h-10 flex items-center justify-center text-slate-600 hover:bg-slate-50 rounded-full transition-colors"
230229
>
@@ -242,7 +241,7 @@ export default function Navbar() {
242241
exit={{ height: 0, opacity: 0 }}
243242
className="lg:hidden overflow-hidden bg-white border-t border-slate-100 rounded-b-[2rem] px-6"
244243
>
245-
<motion.div
244+
<motion.div
246245
initial="closed"
247246
animate="open"
248247
exit="closed"
@@ -260,8 +259,8 @@ export default function Navbar() {
260259
closed: { opacity: 0, x: -10 }
261260
}}
262261
>
263-
<Link
264-
href={item.href}
262+
<Link
263+
href={item.href}
265264
onClick={() => setIsMenuOpen(false)}
266265
className="text-lg font-bold text-slate-900 hover:text-emerald-600 transition-colors"
267266
>
@@ -278,15 +277,15 @@ export default function Navbar() {
278277
</Link>
279278
) : (
280279
<div className="flex flex-col gap-4">
281-
<Link
280+
<Link
282281
href={dashboardPath}
283282
onClick={() => setIsMenuOpen(false)}
284283
className="flex items-center gap-3 text-lg font-bold text-slate-900"
285284
>
286285
<LayoutDashboard className="w-5 h-5 text-emerald-500" />
287286
Dashboard
288287
</Link>
289-
<button
288+
<button
290289
onClick={handleLogout}
291290
className="flex items-center gap-3 text-lg font-bold text-red-500"
292291
>

0 commit comments

Comments
 (0)