From d1b4458e266b5379bd3436783646b254059cb521 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 20 Jan 2026 01:24:43 +0530 Subject: [PATCH] refactor: Standardize user dashboard path to `/user/dashboard` and refine HeroSection helper text styling. --- src/app/(agent)/layout.tsx | 2 +- src/app/page.tsx | 2 +- src/components/home/HeroSection.tsx | 29 ++++++++++++++------------ src/components/layout/CommonHeader.tsx | 2 +- src/components/layout/Header.tsx | 2 +- src/middleware.ts | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/app/(agent)/layout.tsx b/src/app/(agent)/layout.tsx index 0adf3ad..3bfa024 100644 --- a/src/app/(agent)/layout.tsx +++ b/src/app/(agent)/layout.tsx @@ -25,7 +25,7 @@ export default function AgentLayout({ // Redirect non-agents to user dashboard const userRole = (session.user as any)?.role; if (userRole !== 'AGENT') { - router.replace('/user/userdashboard'); + router.replace('/user/dashboard'); } }, [session, status, router]); diff --git a/src/app/page.tsx b/src/app/page.tsx index 2329846..74067a8 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -22,7 +22,7 @@ export default function Home() { if (userRole === 'AGENT') { router.replace('/agent/dashboard'); } else { - router.replace('/user/userdashboard'); + router.replace('/user/dashboard'); } }, [session, status, router]); diff --git a/src/components/home/HeroSection.tsx b/src/components/home/HeroSection.tsx index ec0340e..65ba315 100644 --- a/src/components/home/HeroSection.tsx +++ b/src/components/home/HeroSection.tsx @@ -6,19 +6,15 @@ import Image from 'next/image'; const propertyTypes = [ { value: '', label: 'Types' }, - { value: 'residential', label: 'Residential' }, - { value: 'commercial', label: 'Commercial' }, - { value: 'luxury', label: 'Luxury Homes' }, - { value: 'rentals', label: 'Rentals' }, + { value: 'professionals', label: 'Professionals' }, + { value: 'lenders', label: 'Lenders' }, ]; const categories = [ { value: '', label: 'Categories' }, - { value: 'luxury-broker', label: 'Luxury Broker' }, - { value: 'buying', label: 'Buying Agent' }, - { value: 'selling', label: 'Selling Agent' }, - { value: 'investment', label: 'Investment' }, - { value: 'property-management', label: 'Property Management' }, + { value: 'luxury-homes', label: 'Luxury Homes' }, + { value: 'commercial', label: 'Commercial' }, + { value: 'mortgages', label: 'Mortgages' }, ]; @@ -67,12 +63,15 @@ export function HeroSection() { /> -
+
{/* Headline */} -
+

“Discover verified, top-rated real estate professionals to guide your buying, selling, or investing journey.”

+

+ Discover verified, top-rated real estate professionals +

{/* Search Form */} @@ -179,8 +178,12 @@ export function HeroSection() {
+
+ + {/* Bottom Section - pushed to bottom */} +
{/* See All Agents Button */} -
+
diff --git a/src/components/layout/CommonHeader.tsx b/src/components/layout/CommonHeader.tsx index aff5fee..0312ced 100644 --- a/src/components/layout/CommonHeader.tsx +++ b/src/components/layout/CommonHeader.tsx @@ -20,7 +20,7 @@ export function CommonHeader() { const userRole = (session?.user as any)?.role; // Determine dashboard link based on user role - const dashboardLink = userRole === 'AGENT' ? '/agent/dashboard' : '/user/userdashboard'; + const dashboardLink = userRole === 'AGENT' ? '/agent/dashboard' : '/user/dashboard'; return (
diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 73baacc..4d09ad8 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -47,7 +47,7 @@ export function Header() { {/* Profile */} - + diff --git a/src/middleware.ts b/src/middleware.ts index 34e65f3..b12b19c 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -43,7 +43,7 @@ export default auth((req) => { if (isLoggedIn) { // Prevent regular users from accessing agent routes if (isAgentRoute && userRole !== "AGENT") { - return NextResponse.redirect(new URL("/user/userdashboard", nextUrl.origin)); + return NextResponse.redirect(new URL("/user/dashboard", nextUrl.origin)); } // Prevent agents from accessing user routes