refactor: update location display order to state-first and fix minor typos in auth pages
This commit is contained in:
@@ -81,7 +81,7 @@ export function ProfileSettingsForm({
|
||||
career: profile.headline || profile.agentType?.name || 'Real Estate Agent',
|
||||
email: profile.email || session?.user?.email || '',
|
||||
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);
|
||||
setOriginalData(profileData); // Store original for cancel
|
||||
@@ -102,7 +102,7 @@ export function ProfileSettingsForm({
|
||||
career: '', // Users don't have career/agent type
|
||||
email: profile.email || session?.user?.email || '',
|
||||
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);
|
||||
setOriginalData(profileData); // Store original for cancel
|
||||
@@ -287,7 +287,7 @@ export function ProfileSettingsForm({
|
||||
const role = (session?.user as any)?.role;
|
||||
|
||||
// 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());
|
||||
|
||||
if (role === 'AGENT') {
|
||||
@@ -296,8 +296,8 @@ export function ProfileSettingsForm({
|
||||
lastName: formData.lastName,
|
||||
phone: formData.phone,
|
||||
headline: formData.career,
|
||||
city: locationParts[0] || '',
|
||||
state: locationParts[1] || '',
|
||||
state: locationParts[0] || '',
|
||||
city: locationParts[1] || '',
|
||||
country: locationParts[2] || '',
|
||||
});
|
||||
} else {
|
||||
@@ -305,8 +305,8 @@ export function ProfileSettingsForm({
|
||||
firstName: formData.firstName,
|
||||
lastName: formData.lastName,
|
||||
phone: formData.phone,
|
||||
city: locationParts[0] || undefined,
|
||||
state: locationParts[1] || undefined,
|
||||
state: locationParts[0] || undefined,
|
||||
city: locationParts[1] || undefined,
|
||||
country: locationParts[2] || undefined,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user