fix: code styles

This commit is contained in:
Koosha Lahouti
2025-08-13 11:18:12 +03:30
parent cd4113b75a
commit d42913bced
10 changed files with 51 additions and 25 deletions

View File

@@ -8,6 +8,7 @@ import PhoneEditForm from './phoneNumber/PhoneEditForm';
import PhoneActionButtons from './phoneNumber/PhoneActionButtons';
import apiClient from '@/lib/apiClient';
import { CircularProgress, Box, Typography } from '@mui/material';
import { toLocaleDigits } from '@/utils/persianDigit';
interface Phone {
phone: string;
@@ -31,7 +32,7 @@ interface ConfirmApiResponse extends ApiResponse {
}
export function PhoneNumber() {
const { t } = useTranslation('setting');
const { t, i18n } = useTranslation('setting');
const [isEditing, setIsEditing] = useState(false);
const [phoneNumber, setPhoneNumber] = useState('');
const [verificationCode, setVerificationCode] = useState('');
@@ -274,7 +275,18 @@ export function PhoneNumber() {
t={t}
/>
) : (
<PhoneDisplay phones={phones} />
<PhoneDisplay
phones={phones.map((p) => {
let localPhone = p.withCode;
if (localPhone.startsWith('+98')) {
localPhone = '0' + localPhone.slice(3);
}
return {
...p,
phone: toLocaleDigits(localPhone, i18n.language),
};
})}
/>
)}
</CardContainer>
</PageWrapper>