feat: Enhance user profiles page filter synchronization and refactor common header navigation to use Link components.
This commit is contained in:
@@ -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'
|
||||
}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user