2026-06-18 14:37:55 +05:30
|
|
|
"use client";
|
2026-01-19 08:54:09 +05:30
|
|
|
|
2026-06-18 14:37:55 +05:30
|
|
|
import { useState, useEffect, useRef } from "react";
|
|
|
|
|
import Link from "next/link";
|
|
|
|
|
import Image from "next/image";
|
|
|
|
|
import { useSession } from "next-auth/react";
|
|
|
|
|
import { useHeaderData } from "@/components/providers/header-provider";
|
2026-01-19 08:54:09 +05:30
|
|
|
|
|
|
|
|
const navLinks = [
|
2026-06-18 14:37:55 +05:30
|
|
|
{ label: "Education", href: "/education" },
|
|
|
|
|
{ label: "About Us", href: "/about" },
|
|
|
|
|
{ label: "FAQ's", href: "/faq" },
|
2026-01-19 08:54:09 +05:30
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export function CommonHeader() {
|
2026-03-27 11:56:18 +05:30
|
|
|
const { data: session, status } = useSession();
|
2026-06-18 14:37:55 +05:30
|
|
|
const {
|
|
|
|
|
profileImage,
|
|
|
|
|
profileName,
|
|
|
|
|
avatarLoaded,
|
|
|
|
|
setAvatarLoaded,
|
|
|
|
|
notificationCount,
|
|
|
|
|
messageCount,
|
|
|
|
|
} = useHeaderData();
|
2026-01-19 08:54:09 +05:30
|
|
|
const [showProfileMenu, setShowProfileMenu] = useState(false);
|
2026-03-13 12:41:35 +05:30
|
|
|
const [showGuestMenu, setShowGuestMenu] = useState(false);
|
2026-03-08 11:12:55 +05:30
|
|
|
const [showMobileMenu, setShowMobileMenu] = useState(false);
|
2026-03-27 15:47:29 +05:30
|
|
|
const [avatarError, setAvatarError] = useState(false);
|
2026-02-01 00:06:52 +05:30
|
|
|
const profileMenuRef = useRef<HTMLDivElement>(null);
|
2026-03-13 12:41:35 +05:30
|
|
|
const guestMenuRef = useRef<HTMLDivElement>(null);
|
2026-03-08 11:12:55 +05:30
|
|
|
const mobileMenuRef = useRef<HTMLDivElement>(null);
|
2026-02-01 00:06:52 +05:30
|
|
|
|
2026-03-08 11:12:55 +05:30
|
|
|
// Close dropdowns when clicking outside
|
2026-02-01 00:06:52 +05:30
|
|
|
useEffect(() => {
|
|
|
|
|
function handleClickOutside(event: MouseEvent) {
|
2026-06-18 14:37:55 +05:30
|
|
|
if (
|
|
|
|
|
profileMenuRef.current &&
|
|
|
|
|
!profileMenuRef.current.contains(event.target as Node)
|
|
|
|
|
) {
|
2026-02-01 00:06:52 +05:30
|
|
|
setShowProfileMenu(false);
|
|
|
|
|
}
|
2026-06-18 14:37:55 +05:30
|
|
|
if (
|
|
|
|
|
guestMenuRef.current &&
|
|
|
|
|
!guestMenuRef.current.contains(event.target as Node)
|
|
|
|
|
) {
|
2026-03-13 12:41:35 +05:30
|
|
|
setShowGuestMenu(false);
|
|
|
|
|
}
|
2026-06-18 14:37:55 +05:30
|
|
|
if (
|
|
|
|
|
mobileMenuRef.current &&
|
|
|
|
|
!mobileMenuRef.current.contains(event.target as Node)
|
|
|
|
|
) {
|
2026-03-08 11:12:55 +05:30
|
|
|
setShowMobileMenu(false);
|
|
|
|
|
}
|
2026-02-01 00:06:52 +05:30
|
|
|
}
|
|
|
|
|
|
2026-03-13 12:41:35 +05:30
|
|
|
if (showProfileMenu || showGuestMenu || showMobileMenu) {
|
2026-06-18 14:37:55 +05:30
|
|
|
document.addEventListener("mousedown", handleClickOutside);
|
2026-02-01 00:06:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return () => {
|
2026-06-18 14:37:55 +05:30
|
|
|
document.removeEventListener("mousedown", handleClickOutside);
|
2026-02-01 00:06:52 +05:30
|
|
|
};
|
2026-03-13 12:41:35 +05:30
|
|
|
}, [showProfileMenu, showGuestMenu, showMobileMenu]);
|
2026-01-19 08:54:09 +05:30
|
|
|
|
2026-02-01 00:59:37 +05:30
|
|
|
// Use fetched profile name, fallback to session name
|
|
|
|
|
const userName = profileName || session?.user?.name;
|
2026-01-19 08:54:09 +05:30
|
|
|
const userEmail = session?.user?.email;
|
|
|
|
|
const userRole = (session?.user as any)?.role;
|
2026-06-18 14:37:55 +05:30
|
|
|
const showProfessional = userRole === "AGENT" || userRole === "LENDER";
|
2026-02-01 00:35:22 +05:30
|
|
|
// Use fetched profile image, fallback to session image
|
|
|
|
|
const userImage = profileImage || session?.user?.image;
|
2026-01-19 08:54:09 +05:30
|
|
|
|
2026-05-05 22:51:57 +05:30
|
|
|
// Logo destination — always lands on the user dashboard regardless of role.
|
2026-06-18 14:37:55 +05:30
|
|
|
const dashboardLink = "/user/dashboard";
|
2026-01-19 08:54:09 +05:30
|
|
|
|
|
|
|
|
return (
|
2026-06-18 14:37:55 +05:30
|
|
|
<header
|
|
|
|
|
className="bg-[#648188] rounded-[20px] px-4 md:px-8 relative"
|
|
|
|
|
ref={mobileMenuRef}
|
|
|
|
|
>
|
2026-03-19 18:18:44 +05:30
|
|
|
<div className="flex justify-between items-center h-[60px] md:h-[70px]">
|
2026-01-19 08:54:09 +05:30
|
|
|
{/* Logo */}
|
2026-03-26 11:26:45 +05:30
|
|
|
<Link href={dashboardLink} className="flex-shrink-0 pt-[5px]">
|
2026-01-19 08:54:09 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/logo.svg"
|
|
|
|
|
alt="RE-QuestN"
|
|
|
|
|
width={150}
|
|
|
|
|
height={40}
|
2026-03-13 22:45:11 +05:30
|
|
|
priority
|
2026-03-08 11:12:55 +05:30
|
|
|
className="h-8 md:h-10 w-auto"
|
2026-01-19 08:54:09 +05:30
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
|
2026-03-27 10:35:14 +05:30
|
|
|
{/* Navigation - Desktop only */}
|
2026-06-18 14:37:55 +05:30
|
|
|
{/* <nav className="hidden md:flex items-center gap-8 ml-auto mr-8">
|
|
|
|
|
{navLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.href}
|
|
|
|
|
href={link.href}
|
|
|
|
|
className="font-fractul font-bold text-[14px] leading-[18px] text-[#00293D] hover:text-[#e58625] transition-colors"
|
|
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</nav> */}
|
2026-03-27 10:35:14 +05:30
|
|
|
<nav className="hidden md:flex items-center gap-8 ml-auto mr-8">
|
2026-06-18 14:37:55 +05:30
|
|
|
{showProfessional && (
|
|
|
|
|
<Link
|
|
|
|
|
href="/user/profiles"
|
|
|
|
|
className="font-fractul font-bold text-[14px] leading-[18px] text-[#00293D] hover:text-[#e58625] transition-colors"
|
|
|
|
|
>
|
|
|
|
|
Professional
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-01-19 08:54:09 +05:30
|
|
|
{navLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.href}
|
|
|
|
|
href={link.href}
|
2026-03-05 05:51:57 +05:30
|
|
|
className="font-fractul font-bold text-[14px] leading-[18px] text-[#00293D] hover:text-[#e58625] transition-colors"
|
2026-01-19 08:54:09 +05:30
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
{/* Right Side Icons */}
|
2026-03-08 11:12:55 +05:30
|
|
|
<div className="flex items-center gap-2 md:gap-4">
|
2026-06-18 14:37:55 +05:30
|
|
|
{status === "loading" ? (
|
2026-03-27 11:56:18 +05:30
|
|
|
<div className="w-[35px] h-[35px] rounded-full shimmer-loading" />
|
|
|
|
|
) : session ? (
|
2026-01-19 08:54:09 +05:30
|
|
|
<>
|
2026-04-10 17:44:36 +05:30
|
|
|
{/* Message Icon - User role only */}
|
2026-06-18 14:37:55 +05:30
|
|
|
{userRole === "USER" && (
|
2026-04-10 17:44:36 +05:30
|
|
|
<Link
|
|
|
|
|
href="/user/message"
|
|
|
|
|
className="relative w-6 h-6 flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/message-orange-icon.svg"
|
|
|
|
|
alt="Messages"
|
|
|
|
|
width={20}
|
|
|
|
|
height={18}
|
|
|
|
|
/>
|
|
|
|
|
{messageCount > 0 && (
|
|
|
|
|
<span className="absolute -top-1.5 -right-2 min-w-[18px] h-[18px] bg-red-500 rounded-full flex items-center justify-center px-1">
|
|
|
|
|
<span className="text-white text-[10px] font-bold leading-none">
|
2026-06-18 14:37:55 +05:30
|
|
|
{messageCount > 99 ? "99+" : messageCount}
|
2026-04-10 17:44:36 +05:30
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-01-19 08:54:09 +05:30
|
|
|
{/* Notification Bell */}
|
2026-03-04 22:13:14 +05:30
|
|
|
<Link
|
2026-06-18 14:37:55 +05:30
|
|
|
href={
|
|
|
|
|
userRole === "AGENT"
|
|
|
|
|
? "/agent/notifications"
|
|
|
|
|
: "/user/notifications"
|
|
|
|
|
}
|
2026-02-09 02:27:58 +05:30
|
|
|
className="relative w-6 h-6 flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer"
|
|
|
|
|
>
|
2026-01-19 08:54:09 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/notification-icon.svg"
|
|
|
|
|
alt="Notifications"
|
|
|
|
|
width={20}
|
|
|
|
|
height={22}
|
|
|
|
|
/>
|
2026-02-25 06:45:49 +05:30
|
|
|
{notificationCount > 0 && (
|
|
|
|
|
<span className="absolute -top-1.5 -right-2 min-w-[18px] h-[18px] bg-red-500 rounded-full flex items-center justify-center px-1">
|
|
|
|
|
<span className="text-white text-[10px] font-bold leading-none">
|
2026-06-18 14:37:55 +05:30
|
|
|
{notificationCount > 99 ? "99+" : notificationCount}
|
2026-02-25 06:45:49 +05:30
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
2026-03-04 22:13:14 +05:30
|
|
|
</Link>
|
2026-01-19 08:54:09 +05:30
|
|
|
|
2026-03-08 11:12:55 +05:30
|
|
|
{/* Profile Section */}
|
2026-02-01 00:06:52 +05:30
|
|
|
<div className="relative" ref={profileMenuRef}>
|
2026-01-19 08:54:09 +05:30
|
|
|
<button
|
|
|
|
|
onClick={() => setShowProfileMenu(!showProfileMenu)}
|
2026-03-08 11:12:55 +05:30
|
|
|
className="flex items-center gap-2 md:gap-3 hover:opacity-80 transition-opacity cursor-pointer"
|
2026-01-19 08:54:09 +05:30
|
|
|
>
|
2026-02-01 00:06:52 +05:30
|
|
|
{/* Avatar */}
|
2026-03-13 22:45:11 +05:30
|
|
|
<div className="w-[32px] h-[32px] md:w-[35px] md:h-[35px] rounded-full overflow-hidden border-2 border-[#e58625] bg-gray-100 flex-shrink-0 relative">
|
2026-03-28 17:01:37 +05:30
|
|
|
{/* Shimmer while loading, initials only on error */}
|
|
|
|
|
{avatarError || !userImage ? (
|
|
|
|
|
<div className="absolute inset-0 rounded-full bg-[#c4d9d4] flex items-center justify-center">
|
2026-06-18 14:37:55 +05:30
|
|
|
<span className="font-bold text-[#00293d] text-[14px]">
|
|
|
|
|
{userName?.[0]?.toUpperCase() || "?"}
|
|
|
|
|
</span>
|
2026-03-28 17:01:37 +05:30
|
|
|
</div>
|
|
|
|
|
) : !avatarLoaded ? (
|
|
|
|
|
<div className="absolute inset-0 rounded-full shimmer-loading" />
|
|
|
|
|
) : null}
|
2026-03-27 15:47:29 +05:30
|
|
|
{userImage && !avatarError && (
|
2026-03-13 22:45:11 +05:30
|
|
|
<img
|
2026-06-18 14:37:55 +05:30
|
|
|
ref={(el) => {
|
|
|
|
|
if (el?.complete && el.naturalWidth > 0)
|
|
|
|
|
setAvatarLoaded(true);
|
|
|
|
|
}}
|
2026-03-13 22:45:11 +05:30
|
|
|
src={userImage}
|
|
|
|
|
alt="Profile"
|
2026-06-18 14:37:55 +05:30
|
|
|
className={`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${avatarLoaded ? "opacity-100" : "opacity-0"}`}
|
2026-03-13 22:45:11 +05:30
|
|
|
onLoad={() => setAvatarLoaded(true)}
|
2026-03-27 15:47:29 +05:30
|
|
|
onError={() => setAvatarError(true)}
|
2026-03-13 22:45:11 +05:30
|
|
|
/>
|
|
|
|
|
)}
|
2026-02-01 00:06:52 +05:30
|
|
|
</div>
|
2026-03-08 11:12:55 +05:30
|
|
|
{/* Greeting Text - hidden on mobile */}
|
|
|
|
|
<div className="hidden sm:flex flex-col text-left">
|
2026-02-01 00:06:52 +05:30
|
|
|
<span className="font-bold text-[14px] text-[#e58625] leading-tight">
|
2026-06-18 14:37:55 +05:30
|
|
|
Hi {userName?.split(" ")[0] || "User"} !
|
2026-02-01 00:06:52 +05:30
|
|
|
</span>
|
|
|
|
|
<span className="font-bold text-[9px] text-[#00293d] leading-tight">
|
|
|
|
|
Welcome back !
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-01-19 08:54:09 +05:30
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{/* Profile Dropdown Menu */}
|
|
|
|
|
{showProfileMenu && (
|
2026-02-01 00:06:52 +05:30
|
|
|
<div className="absolute right-0 top-full mt-3 w-[271px] bg-white rounded-[15px] border border-black/20 z-50 shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25)]">
|
|
|
|
|
<div className="absolute -top-2 right-6 w-0 h-0 border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-b-[8px] border-b-white"></div>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-3 px-4 py-4 border-b border-black/10">
|
2026-03-13 22:45:11 +05:30
|
|
|
<div className="w-[42px] h-[42px] rounded-full overflow-hidden flex-shrink-0 bg-gray-100 relative">
|
2026-03-27 15:47:29 +05:30
|
|
|
{/* Initials base layer */}
|
|
|
|
|
<div className="absolute inset-0 rounded-full bg-[#c4d9d4] flex items-center justify-center">
|
2026-06-18 14:37:55 +05:30
|
|
|
<span className="font-bold text-[#00293d] text-[17px]">
|
|
|
|
|
{userName?.[0]?.toUpperCase() || "?"}
|
|
|
|
|
</span>
|
2026-03-27 15:47:29 +05:30
|
|
|
</div>
|
|
|
|
|
{userImage && !avatarError && (
|
2026-03-13 22:45:11 +05:30
|
|
|
<img
|
2026-06-18 14:37:55 +05:30
|
|
|
ref={(el) => {
|
|
|
|
|
if (el?.complete && el.naturalWidth > 0)
|
|
|
|
|
setAvatarLoaded(true);
|
|
|
|
|
}}
|
2026-03-13 22:45:11 +05:30
|
|
|
src={userImage}
|
|
|
|
|
alt="Profile"
|
2026-06-18 14:37:55 +05:30
|
|
|
className={`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${avatarLoaded ? "opacity-100" : "opacity-0"}`}
|
2026-03-13 22:45:11 +05:30
|
|
|
onLoad={() => setAvatarLoaded(true)}
|
2026-03-27 15:47:29 +05:30
|
|
|
onError={() => setAvatarError(true)}
|
2026-03-13 22:45:11 +05:30
|
|
|
/>
|
|
|
|
|
)}
|
2026-02-01 00:06:52 +05:30
|
|
|
</div>
|
2026-03-08 01:46:34 +05:30
|
|
|
<div className="flex flex-col min-w-0 overflow-hidden">
|
2026-02-01 00:06:52 +05:30
|
|
|
<p className="font-fractul font-medium text-[16px] leading-[20px] text-black">
|
2026-06-18 14:37:55 +05:30
|
|
|
{userName?.split(" ")[0] || "User"}
|
2026-02-01 00:06:52 +05:30
|
|
|
</p>
|
2026-03-08 01:46:34 +05:30
|
|
|
<p className="font-serif text-[14px] leading-[18px] text-black/50 truncate">
|
2026-02-01 00:06:52 +05:30
|
|
|
{userEmail}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-01-19 08:54:09 +05:30
|
|
|
</div>
|
2026-02-01 00:06:52 +05:30
|
|
|
|
|
|
|
|
<Link
|
2026-06-18 14:37:55 +05:30
|
|
|
href={
|
|
|
|
|
userRole === "AGENT"
|
|
|
|
|
? "/agent/settings"
|
|
|
|
|
: "/user/settings"
|
|
|
|
|
}
|
2026-02-01 00:06:52 +05:30
|
|
|
className="flex items-center gap-3 px-4 py-3 border-b border-black/10 hover:bg-black/5 transition-colors"
|
|
|
|
|
onClick={() => setShowProfileMenu(false)}
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/settings-icon.svg"
|
|
|
|
|
alt="Settings"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
2026-02-01 00:06:52 +05:30
|
|
|
<div className="flex flex-col">
|
2026-06-18 14:37:55 +05:30
|
|
|
<p className="font-fractul text-[16px] leading-[18px] text-black">
|
|
|
|
|
Account Settings
|
|
|
|
|
</p>
|
|
|
|
|
<p className="font-serif text-[14px] leading-[18px] text-black/50">
|
|
|
|
|
Profile, Security
|
|
|
|
|
</p>
|
2026-02-01 00:06:52 +05:30
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<Link
|
2026-06-18 14:37:55 +05:30
|
|
|
href={
|
|
|
|
|
userRole === "AGENT"
|
|
|
|
|
? "/agent/settings/notifications"
|
|
|
|
|
: "/user/settings/notifications"
|
|
|
|
|
}
|
2026-02-01 00:06:52 +05:30
|
|
|
className="flex items-center gap-3 px-4 py-3 border-b border-black/10 hover:bg-black/5 transition-colors"
|
|
|
|
|
onClick={() => setShowProfileMenu(false)}
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/notification-settings-icon.svg"
|
|
|
|
|
alt="Notifications"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
|
|
|
|
<p className="font-fractul text-[16px] leading-[18px] text-black">
|
|
|
|
|
Notification Settings
|
|
|
|
|
</p>
|
2026-02-01 00:06:52 +05:30
|
|
|
</Link>
|
|
|
|
|
|
2026-06-18 14:37:55 +05:30
|
|
|
{userRole === "AGENT" && (
|
2026-04-29 14:49:38 +05:30
|
|
|
<Link
|
|
|
|
|
href="/agent/dashboard"
|
|
|
|
|
className="flex items-center gap-3 px-4 py-3 border-b border-black/10 hover:bg-black/5 transition-colors"
|
|
|
|
|
onClick={() => setShowProfileMenu(false)}
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/edit-icon.svg"
|
|
|
|
|
alt="Edit Page"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
|
|
|
|
<p className="font-fractul text-[16px] leading-[18px] text-black">
|
|
|
|
|
Edit Page
|
|
|
|
|
</p>
|
2026-04-29 14:49:38 +05:30
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-02-01 00:06:52 +05:30
|
|
|
<button
|
2026-03-08 01:55:46 +05:30
|
|
|
onClick={() => {
|
|
|
|
|
setShowProfileMenu(false);
|
2026-06-18 14:37:55 +05:30
|
|
|
window.location.href = "/logout";
|
2026-03-08 01:55:46 +05:30
|
|
|
}}
|
2026-02-01 00:06:52 +05:30
|
|
|
className="w-full flex items-center gap-3 px-4 py-3 hover:bg-black/5 transition-colors"
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/logout-icon.svg"
|
|
|
|
|
alt="Log Out"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
|
|
|
|
<p className="font-fractul font-bold text-[16px] leading-[18px] text-[#e58625]">
|
|
|
|
|
Log Out
|
|
|
|
|
</p>
|
2026-02-01 00:06:52 +05:30
|
|
|
</button>
|
2026-01-19 08:54:09 +05:30
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
2026-03-13 12:41:35 +05:30
|
|
|
<div className="relative" ref={guestMenuRef}>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setShowGuestMenu(!showGuestMenu)}
|
|
|
|
|
className="flex items-center gap-2 md:gap-3 hover:opacity-80 transition-opacity cursor-pointer"
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/signin-user-icon.svg"
|
|
|
|
|
alt="Sign in"
|
|
|
|
|
width={20}
|
|
|
|
|
height={22}
|
|
|
|
|
/>
|
|
|
|
|
<div className="hidden sm:flex flex-col text-left">
|
|
|
|
|
<span className="font-fractul font-bold text-[14px] text-[#e58625] leading-tight">
|
|
|
|
|
Sign in
|
|
|
|
|
</span>
|
|
|
|
|
<span className="font-fractul font-bold text-[10px] text-[#00293d] leading-tight">
|
2026-04-15 11:47:40 +05:30
|
|
|
Sign in to Connect
|
2026-03-13 12:41:35 +05:30
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{showGuestMenu && (
|
|
|
|
|
<div className="absolute right-0 top-full mt-3 w-[271px] bg-white rounded-[15px] border border-black/20 z-50 shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25)]">
|
|
|
|
|
<div className="absolute -top-2 right-6 w-0 h-0 border-l-[8px] border-l-transparent border-r-[8px] border-r-transparent border-b-[8px] border-b-white"></div>
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-col items-center pt-6 pb-4 border-b border-black/10">
|
|
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/signin-user-icon.svg"
|
|
|
|
|
alt="User"
|
|
|
|
|
width={36}
|
|
|
|
|
height={40}
|
|
|
|
|
/>
|
|
|
|
|
<p className="font-serif text-[14px] text-black/50 mt-3">
|
|
|
|
|
Sign in or create account to continue
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
href="/login"
|
|
|
|
|
className="flex items-center gap-3 px-4 py-3 border-b border-black/10 hover:bg-black/5 transition-colors"
|
|
|
|
|
onClick={() => setShowGuestMenu(false)}
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/settings-icon.svg"
|
|
|
|
|
alt="Settings"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
2026-03-13 12:41:35 +05:30
|
|
|
<div className="flex flex-col">
|
2026-06-18 14:37:55 +05:30
|
|
|
<p className="font-fractul text-[16px] leading-[18px] text-black">
|
|
|
|
|
Account Settings
|
|
|
|
|
</p>
|
|
|
|
|
<p className="font-serif text-[14px] leading-[18px] text-black/50">
|
|
|
|
|
Profile, Security
|
|
|
|
|
</p>
|
2026-03-13 12:41:35 +05:30
|
|
|
</div>
|
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<Link
|
|
|
|
|
href="/login"
|
|
|
|
|
className="flex items-center gap-3 px-4 py-3 border-b border-black/10 hover:bg-black/5 transition-colors"
|
|
|
|
|
onClick={() => setShowGuestMenu(false)}
|
|
|
|
|
>
|
2026-06-18 14:37:55 +05:30
|
|
|
<Image
|
|
|
|
|
src="/assets/icons/notification-settings-icon.svg"
|
|
|
|
|
alt="Notifications"
|
|
|
|
|
width={24}
|
|
|
|
|
height={24}
|
|
|
|
|
/>
|
|
|
|
|
<p className="font-fractul text-[16px] leading-[18px] text-black">
|
|
|
|
|
Notification Settings
|
|
|
|
|
</p>
|
2026-03-13 12:41:35 +05:30
|
|
|
</Link>
|
|
|
|
|
|
|
|
|
|
<div className="flex gap-3 px-4 py-4">
|
|
|
|
|
<Link
|
|
|
|
|
href="/signup"
|
|
|
|
|
onClick={() => setShowGuestMenu(false)}
|
|
|
|
|
className="flex-1 h-[37px] bg-[#e58625] rounded-[15px] flex items-center justify-center font-fractul text-[14px] text-white hover:bg-[#d47920] transition-colors"
|
|
|
|
|
>
|
|
|
|
|
Sign up
|
|
|
|
|
</Link>
|
|
|
|
|
<Link
|
|
|
|
|
href="/login"
|
|
|
|
|
onClick={() => setShowGuestMenu(false)}
|
|
|
|
|
className="flex-1 h-[37px] border border-[#e58625] rounded-[15px] flex items-center justify-center font-fractul text-[14px] text-[#e58625] hover:bg-[#e58625]/5 transition-colors"
|
|
|
|
|
>
|
|
|
|
|
Login
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-01-19 08:54:09 +05:30
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Mobile Menu Button */}
|
2026-03-08 11:12:55 +05:30
|
|
|
<button
|
|
|
|
|
className="md:hidden p-1 hover:opacity-80 transition-opacity"
|
|
|
|
|
onClick={() => setShowMobileMenu(!showMobileMenu)}
|
|
|
|
|
>
|
2026-01-19 08:54:09 +05:30
|
|
|
<svg
|
|
|
|
|
className="w-6 h-6 text-[#00293d]"
|
|
|
|
|
fill="none"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
>
|
2026-03-08 11:12:55 +05:30
|
|
|
{showMobileMenu ? (
|
2026-06-18 14:37:55 +05:30
|
|
|
<path
|
|
|
|
|
strokeLinecap="round"
|
|
|
|
|
strokeLinejoin="round"
|
|
|
|
|
strokeWidth={2}
|
|
|
|
|
d="M6 18L18 6M6 6l12 12"
|
|
|
|
|
/>
|
2026-03-08 11:12:55 +05:30
|
|
|
) : (
|
2026-06-18 14:37:55 +05:30
|
|
|
<path
|
|
|
|
|
strokeLinecap="round"
|
|
|
|
|
strokeLinejoin="round"
|
|
|
|
|
strokeWidth={2}
|
|
|
|
|
d="M4 6h16M4 12h16M4 18h16"
|
|
|
|
|
/>
|
2026-03-08 11:12:55 +05:30
|
|
|
)}
|
2026-01-19 08:54:09 +05:30
|
|
|
</svg>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-03-08 11:12:55 +05:30
|
|
|
|
|
|
|
|
{/* Mobile Navigation Menu */}
|
|
|
|
|
{showMobileMenu && (
|
|
|
|
|
<div className="md:hidden border-t border-white/20 py-3 pb-4">
|
2026-06-18 14:37:55 +05:30
|
|
|
{/* <nav className="flex flex-col gap-1">
|
|
|
|
|
{navLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.href}
|
|
|
|
|
href={link.href}
|
|
|
|
|
onClick={() => setShowMobileMenu(false)}
|
|
|
|
|
className="font-fractul font-bold text-[14px] text-[#00293D] hover:text-[#e58625] transition-colors px-2 py-2 rounded-[10px] hover:bg-white/10"
|
|
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</nav> */}
|
2026-03-08 11:12:55 +05:30
|
|
|
<nav className="flex flex-col gap-1">
|
2026-06-18 14:37:55 +05:30
|
|
|
{showProfessional && (
|
|
|
|
|
<Link
|
|
|
|
|
href="/user/profiles"
|
|
|
|
|
onClick={() => setShowMobileMenu(false)}
|
|
|
|
|
className="font-fractul font-bold text-[14px] text-[#00293D] hover:text-[#e58625] transition-colors px-2 py-2 rounded-[10px] hover:bg-white/10"
|
|
|
|
|
>
|
|
|
|
|
Professional
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-03-08 11:12:55 +05:30
|
|
|
{navLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.href}
|
|
|
|
|
href={link.href}
|
|
|
|
|
onClick={() => setShowMobileMenu(false)}
|
|
|
|
|
className="font-fractul font-bold text-[14px] text-[#00293D] hover:text-[#e58625] transition-colors px-2 py-2 rounded-[10px] hover:bg-white/10"
|
|
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-01-19 08:54:09 +05:30
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|