fix
This commit is contained in:
@@ -282,15 +282,6 @@ export default function LoginPage() {
|
|||||||
>
|
>
|
||||||
<img src="/assets/icons/x.svg" alt="X" className="w-6 h-6" />
|
<img src="/assets/icons/x.svg" alt="X" className="w-6 h-6" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Facebook */}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => handleSocialLogin('facebook')}
|
|
||||||
className="w-10 h-10 flex items-center justify-center hover:opacity-70 transition-opacity"
|
|
||||||
>
|
|
||||||
<img src="/assets/icons/facebook.svg" alt="Facebook" className="w-6 h-6" />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Don't Have Account */}
|
{/* Don't Have Account */}
|
||||||
|
|||||||
@@ -345,15 +345,6 @@ export default function SignUpPage() {
|
|||||||
>
|
>
|
||||||
<img src="/assets/icons/x.svg" alt="X" className="w-6 h-6" />
|
<img src="/assets/icons/x.svg" alt="X" className="w-6 h-6" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Facebook */}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => handleSocialLogin('facebook')}
|
|
||||||
className="w-10 h-10 flex items-center justify-center hover:opacity-70 transition-opacity"
|
|
||||||
>
|
|
||||||
<img src="/assets/icons/facebook.svg" alt="Facebook" className="w-6 h-6" />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -120,8 +120,12 @@ function ProfileCard({ profile, resolvedAvatarUrl }: ProfileCardProps) {
|
|||||||
let cityValue: string | null = null;
|
let cityValue: string | null = null;
|
||||||
let stateValue: string | null = null;
|
let stateValue: string | null = null;
|
||||||
|
|
||||||
// Helper to format snake_case to Title Case
|
// Helper to format snake_case to Title Case, with uppercase for 2-letter state codes
|
||||||
const formatValue = (v: string) => v.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');
|
const formatValue = (v: string) => {
|
||||||
|
const trimmed = v.trim();
|
||||||
|
if (/^[a-z]{2}$/i.test(trimmed)) return trimmed.toUpperCase();
|
||||||
|
return trimmed.split('_').map(w => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');
|
||||||
|
};
|
||||||
|
|
||||||
// First, check fieldValues for state and city (dynamic profile fields)
|
// First, check fieldValues for state and city (dynamic profile fields)
|
||||||
if (profile.fieldValues && profile.fieldValues.length > 0) {
|
if (profile.fieldValues && profile.fieldValues.length > 0) {
|
||||||
@@ -131,7 +135,6 @@ function ProfileCard({ profile, resolvedAvatarUrl }: ProfileCardProps) {
|
|||||||
if (stateField && stateField.jsonValue) {
|
if (stateField && stateField.jsonValue) {
|
||||||
const value = stateField.jsonValue;
|
const value = stateField.jsonValue;
|
||||||
if (Array.isArray(value) && value.length > 0) {
|
if (Array.isArray(value) && value.length > 0) {
|
||||||
// For multiselect, join all selected values
|
|
||||||
stateValue = value.map(v => formatValue(String(v))).join(', ');
|
stateValue = value.map(v => formatValue(String(v))).join(', ');
|
||||||
} else if (typeof value === 'string' && value.trim()) {
|
} else if (typeof value === 'string' && value.trim()) {
|
||||||
stateValue = formatValue(value);
|
stateValue = formatValue(value);
|
||||||
|
|||||||
@@ -337,7 +337,10 @@ export function mapFieldValuesToAvailability(fieldValues: FieldValueResponse[]):
|
|||||||
* Helper to format snake_case values to Title Case
|
* Helper to format snake_case values to Title Case
|
||||||
*/
|
*/
|
||||||
function formatSnakeCaseToTitleCase(value: string): string {
|
function formatSnakeCaseToTitleCase(value: string): string {
|
||||||
return value
|
const trimmed = value.trim();
|
||||||
|
// 2-letter state abbreviation: uppercase both letters
|
||||||
|
if (/^[a-z]{2}$/i.test(trimmed)) return trimmed.toUpperCase();
|
||||||
|
return trimmed
|
||||||
.split('_')
|
.split('_')
|
||||||
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
||||||
.join(' ');
|
.join(' ');
|
||||||
|
|||||||
Reference in New Issue
Block a user