refactor: Standardize user dashboard path to /user/dashboard and refine HeroSection helper text styling.
This commit is contained in:
@@ -25,7 +25,7 @@ export default function AgentLayout({
|
|||||||
// Redirect non-agents to user dashboard
|
// Redirect non-agents to user dashboard
|
||||||
const userRole = (session.user as any)?.role;
|
const userRole = (session.user as any)?.role;
|
||||||
if (userRole !== 'AGENT') {
|
if (userRole !== 'AGENT') {
|
||||||
router.replace('/user/userdashboard');
|
router.replace('/user/dashboard');
|
||||||
}
|
}
|
||||||
}, [session, status, router]);
|
}, [session, status, router]);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function Home() {
|
|||||||
if (userRole === 'AGENT') {
|
if (userRole === 'AGENT') {
|
||||||
router.replace('/agent/dashboard');
|
router.replace('/agent/dashboard');
|
||||||
} else {
|
} else {
|
||||||
router.replace('/user/userdashboard');
|
router.replace('/user/dashboard');
|
||||||
}
|
}
|
||||||
}, [session, status, router]);
|
}, [session, status, router]);
|
||||||
|
|
||||||
|
|||||||
@@ -6,19 +6,15 @@ import Image from 'next/image';
|
|||||||
|
|
||||||
const propertyTypes = [
|
const propertyTypes = [
|
||||||
{ value: '', label: 'Types' },
|
{ value: '', label: 'Types' },
|
||||||
{ value: 'residential', label: 'Residential' },
|
{ value: 'professionals', label: 'Professionals' },
|
||||||
{ value: 'commercial', label: 'Commercial' },
|
{ value: 'lenders', label: 'Lenders' },
|
||||||
{ value: 'luxury', label: 'Luxury Homes' },
|
|
||||||
{ value: 'rentals', label: 'Rentals' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const categories = [
|
const categories = [
|
||||||
{ value: '', label: 'Categories' },
|
{ value: '', label: 'Categories' },
|
||||||
{ value: 'luxury-broker', label: 'Luxury Broker' },
|
{ value: 'luxury-homes', label: 'Luxury Homes' },
|
||||||
{ value: 'buying', label: 'Buying Agent' },
|
{ value: 'commercial', label: 'Commercial' },
|
||||||
{ value: 'selling', label: 'Selling Agent' },
|
{ value: 'mortgages', label: 'Mortgages' },
|
||||||
{ value: 'investment', label: 'Investment' },
|
|
||||||
{ value: 'property-management', label: 'Property Management' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -67,12 +63,15 @@ export function HeroSection() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="relative max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 pt-28 pb-24">
|
<div className="relative max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 pt-28 pb-8 min-h-[600px] flex flex-col">
|
||||||
{/* Headline */}
|
{/* Headline */}
|
||||||
<div className="text-center mb-8">
|
<div className="text-center mb-5">
|
||||||
<h1 className="font-fractul font-bold text-[24px] md:text-[28px] lg:text-[30px] leading-[50px] text-[#00293d] max-w-4xl mx-auto">
|
<h1 className="font-fractul font-bold text-[24px] md:text-[28px] lg:text-[30px] leading-[50px] text-[#00293d] max-w-4xl mx-auto">
|
||||||
“Discover verified, top-rated real estate professionals to guide your buying, selling, or investing journey.”
|
“Discover verified, top-rated real estate professionals to guide your buying, selling, or investing journey.”
|
||||||
</h1>
|
</h1>
|
||||||
|
<p className="font-fractul font-bold text-[20px] md:text-[24px] leading-[40px] text-[#00293d] mt-2">
|
||||||
|
Discover verified, top-rated real estate professionals
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Search Form */}
|
{/* Search Form */}
|
||||||
@@ -179,8 +178,12 @@ export function HeroSection() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Bottom Section - pushed to bottom */}
|
||||||
|
<div className="mt-auto">
|
||||||
{/* See All Agents Button */}
|
{/* See All Agents Button */}
|
||||||
<div className="flex justify-center mt-6">
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
onClick={handleSeeAllAgents}
|
onClick={handleSeeAllAgents}
|
||||||
className="px-8 py-3 rounded-[15px] bg-[#e58625] hover:bg-[#d47720] text-[#00293d] font-fractul font-bold text-base transition-colors shadow-md hover:shadow-lg"
|
className="px-8 py-3 rounded-[15px] bg-[#e58625] hover:bg-[#d47720] text-[#00293d] font-fractul font-bold text-base transition-colors shadow-md hover:shadow-lg"
|
||||||
@@ -190,7 +193,7 @@ export function HeroSection() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Helper Text */}
|
{/* Helper Text */}
|
||||||
<p className="text-center font-serif text-sm text-[#00293d]/60 mt-4 max-w-2xl mx-auto">
|
<p className="text-center font-serif font-normal text-[14px] leading-[19px] text-[#00293D] mt-3 max-w-[419px] mx-auto">
|
||||||
Connect with trusted local agents to explore homes, compare options, and make smarter decisions.
|
Connect with trusted local agents to explore homes, compare options, and make smarter decisions.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function CommonHeader() {
|
|||||||
const userRole = (session?.user as any)?.role;
|
const userRole = (session?.user as any)?.role;
|
||||||
|
|
||||||
// Determine dashboard link based on user 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 (
|
return (
|
||||||
<header className="bg-[#648188] rounded-[20px] px-8">
|
<header className="bg-[#648188] rounded-[20px] px-8">
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function Header() {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
{/* Profile */}
|
{/* Profile */}
|
||||||
<Link href="/user/userdashboard" className="p-2 hover:bg-white/10 rounded-full transition-colors">
|
<Link href="/user/dashboard" className="p-2 hover:bg-white/10 rounded-full transition-colors">
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default auth((req) => {
|
|||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
// Prevent regular users from accessing agent routes
|
// Prevent regular users from accessing agent routes
|
||||||
if (isAgentRoute && userRole !== "AGENT") {
|
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
|
// Prevent agents from accessing user routes
|
||||||
|
|||||||
Reference in New Issue
Block a user