feat: Enhance user profiles page filter synchronization and refactor common header navigation to use Link components.

This commit is contained in:
pradeepkumar
2026-03-04 22:13:14 +05:30
parent 27d3a24605
commit a1c128ea2f
2 changed files with 25 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
import { useState, useEffect, useRef, useCallback } from 'react';
import Link from 'next/link';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
import { useSession, signOut } from 'next-auth/react';
import { agentsService } from '@/services/agents.service';
import { usersService } from '@/services/users.service';
@@ -18,7 +18,6 @@ const navLinks = [
export function CommonHeader() {
const { data: session } = useSession();
const router = useRouter();
const [showProfileMenu, setShowProfileMenu] = useState(false);
const profileMenuRef = useRef<HTMLDivElement>(null);
const [profileImage, setProfileImage] = useState<string | null>(null);
@@ -135,7 +134,7 @@ export function CommonHeader() {
<header className="bg-[#648188] rounded-[20px] px-8">
<div className="flex justify-between items-center h-[70px]">
{/* Logo */}
<Link href="/">
<Link href={dashboardLink}>
<Image
src="/assets/logo.svg"
alt="RE-QuestN"
@@ -163,8 +162,8 @@ export function CommonHeader() {
{session ? (
<>
{/* Notification Bell */}
<button
onClick={() => router.push(userRole === 'AGENT' ? '/agent/notifications' : '/user/notifications')}
<Link
href={userRole === 'AGENT' ? '/agent/notifications' : '/user/notifications'}
className="relative w-6 h-6 flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer"
>
<Image
@@ -181,7 +180,7 @@ export function CommonHeader() {
</span>
</span>
)}
</button>
</Link>
{/* Profile Section with Greeting - Entire area clickable */}
<div className="relative" ref={profileMenuRef}>