diff --git a/src/components/profile/ProfileFormFields.jsx b/src/components/profile/ProfileFormFields.jsx index 9a6910a..bfaa04e 100644 --- a/src/components/profile/ProfileFormFields.jsx +++ b/src/components/profile/ProfileFormFields.jsx @@ -99,27 +99,19 @@ function NameFieldsRow({ form, errors, onChange }) { } // ─── Contact fields ───────────────────────────────────────────────────────── -function ContactFields({ form, errors, onChange, onPhoneChange }) { +// Email в окне профиля не показываем: он не редактируется здесь, но остаётся +// в состоянии формы и уходит при сохранении без изменений. +function ContactFields({ form, errors, onPhoneChange }) { const { t } = useTranslation(); return ( - <> - onPhoneChange(e.target.value)} - /> - onChange("email", e.target.value)} - /> - + onPhoneChange(e.target.value)} + /> ); } diff --git a/src/components/profile/profileValidation.js b/src/components/profile/profileValidation.js index dcb3389..5df7f49 100644 --- a/src/components/profile/profileValidation.js +++ b/src/components/profile/profileValidation.js @@ -12,10 +12,6 @@ export function validateProfileForm(form) { errors.lastName = i18n.t('profile.validateSurnameRequired'); } - if (form.email && !form.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) { - errors.email = i18n.t('profile.validateEmailInvalid'); - } - if (form.phone && form.phone.replace(/\D/g, "").length < 11) { errors.phone = i18n.t('profile.validatePhoneInvalid'); }