fix: code styles
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user