refactor: update location display order to state-first and fix minor typos in auth pages

This commit is contained in:
pradeepkumar
2026-04-11 22:52:11 +05:30
parent bfcb37c2ee
commit 11c3fdfde8
8 changed files with 18 additions and 18 deletions

View File

@@ -424,8 +424,8 @@ export default function AgentDashboard() {
title={agentProfile.agentType?.name || 'Real Estate Agent'} title={agentProfile.agentType?.name || 'Real Estate Agent'}
location={ location={
profileCardData.city && profileCardData.state profileCardData.city && profileCardData.state
? `${profileCardData.city}, ${profileCardData.state}` ? `${profileCardData.state}, ${profileCardData.city}`
: profileCardData.city || profileCardData.state || profileCardData.serviceAreas?.[0] || 'United States' : profileCardData.state || profileCardData.city || profileCardData.serviceAreas?.[0] || 'United States'
} }
memberSince={formatMemberSince((agentProfile as unknown as { createdAt?: string }).createdAt)} memberSince={formatMemberSince((agentProfile as unknown as { createdAt?: string }).createdAt)}
bio={profileCardData.bio || agentProfile.bio || ''} bio={profileCardData.bio || agentProfile.bio || ''}

View File

@@ -66,7 +66,7 @@ export default function ForgotPasswordPage() {
<> <>
{/* Forgot Password Heading */} {/* Forgot Password Heading */}
<div className="text-center mb-6"> <div className="text-center mb-6">
<h2 className="text-[30px] font-normal text-[#00293d] font-fractul mb-3">Forget Your Password</h2> <h2 className="text-[30px] font-normal text-[#00293d] font-fractul mb-3">Forgot Your Password</h2>
<p className="text-[14px] text-[#00293d] px-4 leading-[20px] font-fractul"> <p className="text-[14px] text-[#00293d] px-4 leading-[20px] font-fractul">
Enter your registered email to reset your password. Enter your registered email to reset your password.
</p> </p>

View File

@@ -144,7 +144,7 @@ export default function LoginPage() {
<div className="text-center mb-6"> <div className="text-center mb-6">
<h2 className="text-[30px] font-normal text-[#00293d] font-fractul mb-3">Login</h2> <h2 className="text-[30px] font-normal text-[#00293d] font-fractul mb-3">Login</h2>
<p className="text-[14px] text-[#00293d] px-4 leading-[20px] font-fractul"> <p className="text-[14px] text-[#00293d] px-4 leading-[20px] font-fractul">
Login or create an account to enjoy FREE consultation on all property inquiries. Login or create an account
</p> </p>
</div> </div>
@@ -242,7 +242,7 @@ export default function LoginPage() {
{/* Forgot Password Link */} {/* Forgot Password Link */}
<div className="text-right"> <div className="text-right">
<Link href="/forgot-password" className="text-[#00293d] text-[14px] font-light font-serif leading-[24px] hover:underline"> <Link href="/forgot-password" className="text-[#00293d] text-[14px] font-light font-serif leading-[24px] hover:underline">
Forget Your Password ? Forgot Your Password?
</Link> </Link>
</div> </div>

View File

@@ -353,8 +353,8 @@ export default function AgentProfileView() {
isVerified={agentProfile.isVerified} isVerified={agentProfile.isVerified}
title={agentProfile.agentType?.name || 'Real Estate Agent'} title={agentProfile.agentType?.name || 'Real Estate Agent'}
location={profileCardData.city && profileCardData.state location={profileCardData.city && profileCardData.state
? `${profileCardData.city}, ${profileCardData.state}` ? `${profileCardData.state}, ${profileCardData.city}`
: profileCardData.city || profileCardData.state || agentProfile.serviceAreas?.[0] || '-'} : profileCardData.state || profileCardData.city || agentProfile.serviceAreas?.[0] || '-'}
memberSince={formatMemberSince((agentProfile as unknown as { createdAt?: string }).createdAt)} memberSince={formatMemberSince((agentProfile as unknown as { createdAt?: string }).createdAt)}
bio={profileCardData.bio || agentProfile.bio || ''} bio={profileCardData.bio || agentProfile.bio || ''}
expertise={profileCardData.expertise.length > 0 ? profileCardData.expertise : (agentProfile.specializations || [])} expertise={profileCardData.expertise.length > 0 ? profileCardData.expertise : (agentProfile.specializations || [])}

View File

@@ -157,9 +157,9 @@ function ProfileCard({ profile, resolvedAvatarUrl }: ProfileCardProps) {
stateValue = profile.state; stateValue = profile.state;
} }
// Build location string // Build location string (state first, then city)
if (cityValue && stateValue) { if (cityValue && stateValue) {
return `${cityValue}, ${stateValue}`; return `${stateValue}, ${cityValue}`;
} }
if (cityValue && profile.country) { if (cityValue && profile.country) {
return `${cityValue}, ${profile.country}`; return `${cityValue}, ${profile.country}`;

View File

@@ -771,7 +771,7 @@ export function MessagingPage({ initialConversationId, initialAgentProfileId }:
)} )}
{(agent.city || agent.state) && ( {(agent.city || agent.state) && (
<p className="font-serif font-normal text-[12px] leading-[16px] text-[#00293D]/50"> <p className="font-serif font-normal text-[12px] leading-[16px] text-[#00293D]/50">
{[agent.city, agent.state].filter(Boolean).join(', ')} {[agent.state, agent.city].filter(Boolean).join(', ')}
</p> </p>
)} )}
</div> </div>

View File

@@ -162,7 +162,7 @@ export function NewConversationModal({
)} )}
{(contact.city || contact.state) && ( {(contact.city || contact.state) && (
<p className="font-serif font-normal text-[11px] leading-[14px] text-[#00293D]/50"> <p className="font-serif font-normal text-[11px] leading-[14px] text-[#00293D]/50">
{[contact.city, contact.state].filter(Boolean).join(', ')} {[contact.state, contact.city].filter(Boolean).join(', ')}
</p> </p>
)} )}
</div> </div>

View File

@@ -81,7 +81,7 @@ export function ProfileSettingsForm({
career: profile.headline || profile.agentType?.name || 'Real Estate Agent', career: profile.headline || profile.agentType?.name || 'Real Estate Agent',
email: profile.email || session?.user?.email || '', email: profile.email || session?.user?.email || '',
phone: profile.phone || '', phone: profile.phone || '',
location: [profile.city, profile.state, profile.country].filter(Boolean).join(', '), location: [profile.state, profile.city, profile.country].filter(Boolean).join(', '),
}; };
setFormData(profileData); setFormData(profileData);
setOriginalData(profileData); // Store original for cancel setOriginalData(profileData); // Store original for cancel
@@ -102,7 +102,7 @@ export function ProfileSettingsForm({
career: '', // Users don't have career/agent type career: '', // Users don't have career/agent type
email: profile.email || session?.user?.email || '', email: profile.email || session?.user?.email || '',
phone: profile.phone || '', phone: profile.phone || '',
location: [profile.city, profile.state, profile.country].filter(Boolean).join(', '), location: [profile.state, profile.city, profile.country].filter(Boolean).join(', '),
}; };
setFormData(profileData); setFormData(profileData);
setOriginalData(profileData); // Store original for cancel setOriginalData(profileData); // Store original for cancel
@@ -287,7 +287,7 @@ export function ProfileSettingsForm({
const role = (session?.user as any)?.role; const role = (session?.user as any)?.role;
// Update profile based on role (email is not editable - tied to auth) // Update profile based on role (email is not editable - tied to auth)
// Parse location into city, state, country // Parse location into state, city, country (display order is state first)
const locationParts = formData.location.split(',').map(s => s.trim()); const locationParts = formData.location.split(',').map(s => s.trim());
if (role === 'AGENT') { if (role === 'AGENT') {
@@ -296,8 +296,8 @@ export function ProfileSettingsForm({
lastName: formData.lastName, lastName: formData.lastName,
phone: formData.phone, phone: formData.phone,
headline: formData.career, headline: formData.career,
city: locationParts[0] || '', state: locationParts[0] || '',
state: locationParts[1] || '', city: locationParts[1] || '',
country: locationParts[2] || '', country: locationParts[2] || '',
}); });
} else { } else {
@@ -305,8 +305,8 @@ export function ProfileSettingsForm({
firstName: formData.firstName, firstName: formData.firstName,
lastName: formData.lastName, lastName: formData.lastName,
phone: formData.phone, phone: formData.phone,
city: locationParts[0] || undefined, state: locationParts[0] || undefined,
state: locationParts[1] || undefined, city: locationParts[1] || undefined,
country: locationParts[2] || undefined, country: locationParts[2] || undefined,
}); });
} }