mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
fix(profile): use displayName helper for name field
Follow-up to displayName migration. Profile page still rendered
`{user?.first_name} {user?.last_name}` directly, leaving a trailing space when
last_name is null. displayName() handles the joining and fallback uniformly.
This commit is contained in:
@@ -5,6 +5,7 @@ import { usePlatform } from '@/platform';
|
|||||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import { motion, AnimatePresence } from 'framer-motion';
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
import { useAuthStore } from '../store/auth';
|
import { useAuthStore } from '../store/auth';
|
||||||
|
import { displayName } from '../utils/displayName';
|
||||||
import { authApi } from '../api/auth';
|
import { authApi } from '../api/auth';
|
||||||
import { isValidEmail } from '../utils/validation';
|
import { isValidEmail } from '../utils/validation';
|
||||||
import {
|
import {
|
||||||
@@ -333,9 +334,7 @@ export default function Profile() {
|
|||||||
)}
|
)}
|
||||||
<div className="flex items-center justify-between border-b border-dark-800/50 py-3">
|
<div className="flex items-center justify-between border-b border-dark-800/50 py-3">
|
||||||
<span className="text-dark-400">{t('profile.name')}</span>
|
<span className="text-dark-400">{t('profile.name')}</span>
|
||||||
<span className="font-medium text-dark-100">
|
<span className="font-medium text-dark-100">{displayName(user)}</span>
|
||||||
{user?.first_name} {user?.last_name}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center justify-between py-3">
|
<div className="flex items-center justify-between py-3">
|
||||||
<span className="text-dark-400">{t('profile.registeredAt')}</span>
|
<span className="text-dark-400">{t('profile.registeredAt')}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user