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

@@ -534,6 +534,24 @@ function ProfilesPageContent() {
const handleTypeChange = (typeId: string | null) => {
setActiveTypeId(typeId);
setCurrentPage(1);
// Sync listing type sidebar with agent type tab selection
if (typeId) {
const matchedType = agentTypes.find(t => t.id === typeId);
if (matchedType?.name === 'Lender') {
setListingType('lenders');
} else {
setListingType('agents');
}
}
};
const handleListingTypeChange = (type: 'agents' | 'lenders') => {
setListingType(type);
// Map listing type to the corresponding agent type and filter
const typeName = type === 'agents' ? 'Professional' : 'Lender';
const matchedType = agentTypes.find(t => t.name === typeName);
setActiveTypeId(matchedType?.id || null);
setCurrentPage(1);
};
// Get filter field by slug for sidebar
@@ -555,14 +573,14 @@ function ProfilesPageContent() {
<h2 className="font-fractul font-bold text-[14px] text-[#00293d] mb-3">Listing Type</h2>
<div className="space-y-2">
<button
onClick={() => setListingType('agents')}
onClick={() => handleListingTypeChange('agents')}
className={`block font-serif text-[14px] ${listingType === 'agents' ? 'text-[#00293d] font-medium' : 'text-[#00293d]/70'
}`}
>
Agents
</button>
<button
onClick={() => setListingType('lenders')}
onClick={() => handleListingTypeChange('lenders')}
className={`block font-serif text-[14px] ${listingType === 'lenders' ? 'text-[#00293d] font-medium' : 'text-[#00293d]/70'
}`}
>