diff --git a/src/app/(user)/user/profiles/page.tsx b/src/app/(user)/user/profiles/page.tsx index 4a399ad..678c219 100644 --- a/src/app/(user)/user/profiles/page.tsx +++ b/src/app/(user)/user/profiles/page.tsx @@ -409,6 +409,7 @@ function ProfilesPageContent() { const nameFromUrl = searchParams.get('name') || ''; const locationFromUrl = searchParams.get('location') || ''; const filtersFromUrl = searchParams.get('filters') || ''; + const listingFromUrl = searchParams.get('listing') as 'agents' | 'lenders' | null; // State for API data const [agents, setAgents] = useState([]); @@ -424,7 +425,7 @@ function ProfilesPageContent() { // State for search and filters - initialize from URL params const [searchQuery, setSearchQuery] = useState(nameFromUrl); const [activeTypeId, setActiveTypeId] = useState(typeFromUrl); - const [listingType, setListingType] = useState<'agents' | 'lenders'>('agents'); + const [listingType, setListingType] = useState<'agents' | 'lenders'>(listingFromUrl || 'agents'); const [isFilterModalOpen, setIsFilterModalOpen] = useState(false); const [filters, setFilters] = useState(() => { if (filtersFromUrl) { @@ -460,6 +461,15 @@ function ProfilesPageContent() { ]); setAgentTypes(types); + // If listing param is set, auto-select the matching agent type + if (listingFromUrl && !typeFromUrl) { + const typeName = listingFromUrl === 'lenders' ? 'Lender' : 'Professional'; + const matchedType = types.find((t: AgentType) => t.name === typeName); + if (matchedType) { + setActiveTypeId(matchedType.id); + } + } + // Convert FilterableField to FilterField format const filterFieldsData: FilterField[] = fields.map((f: FilterableField) => ({ slug: f.slug, diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index fa42151..dd78463 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -4,18 +4,11 @@ import Link from 'next/link'; import Image from 'next/image'; const footerLinks = { - services: { - title: 'Services', - links: [ - { label: 'Neighborhood Guides', href: '#' }, - { label: 'Home Loan & EMI Calculator', href: '#' }, - ], - }, serviceProviders: { title: 'Service Providers', links: [ - { label: 'Agent', href: '/education' }, - { label: 'Lenders', href: '#' }, + { label: 'Agent', href: '/user/profiles?listing=agents' }, + { label: 'Lenders', href: '/user/profiles?listing=lenders' }, ], }, resources: { @@ -24,7 +17,6 @@ const footerLinks = { { label: "Buyer's Guide", href: '#' }, { label: "Seller's Guide", href: '#' }, { label: 'FAQs', href: '/faq' }, - { label: 'Blogs', href: '#' }, { label: 'Legal & Documentation Help', href: '#' }, ], }, @@ -33,8 +25,6 @@ const footerLinks = { links: [ { label: 'About Our Agency', href: '/about' }, { label: 'Our Agents', href: '/education' }, - { label: 'Testimonials', href: '/testimonials' }, - { label: 'Careers', href: '#' }, { label: 'Contact Us', href: '/contact' }, { label: 'Privacy Policy', href: '/privacy-policy' }, { label: 'Terms & Conditions', href: '/terms-of-service' }, @@ -90,27 +80,7 @@ export function Footer() {