Skip to content

Conversation

@RomashNat
Copy link

@RomashNat RomashNat commented Dec 10, 2025

Реализованы компоненты:

ForgotPasswordModal.tsx - модальное окно восстановления пароля

  • Поле ввода email пользователя с валидацией формата
  • Уведомление об успешной отправке письма
  • Интеграция с системой переводов (i18n)
  • Обработка состояний загрузки и ошибок

Header.tsx - интеграция модалки в хедер

  • Добавлена кнопка "Забыли пароль?"
  • Открытие модального окна по клику

Переводы (ru.ts / en.ts) - добавлены основные ключи

@aisaenok
Copy link

Прикрепи ссылку на задачу пожалуйста

"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-plugin-react-x": "^2.3.9",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а что он дает? сейчас скорость низкая?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот ссылка #793 Да я сейчас все переделываю, с учетом изменений на сегодняшний день. Смерджила основной репозиторий со своим, проект собрался и отображает страницу с новыми изменениями

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я убрала "eslint-plugin-react-x": "^2.3.9"

@RomashNat RomashNat changed the title Created modal Frontend: Создание компонента "Модальное окно для сброса пароля" #793 Dec 22, 2025
@@ -1,6 +1,11 @@
<<<<<<< HEAD:frontend/src/Pages/Home.tsx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

конфликты

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ты их точечно апала или они версии поднялись?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это у меня произошло

Copy link

@aisaenok aisaenok Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

откати версии тогда, если обновляешь зависиомсти, например, после удаления папки node_modules, используй команду npm ci вместо npm install

<Text size="sm" c="dimmed">
{t('auth.forgotPassword.description')}
</Text>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не надо этих новых строк, они ничего не дают + форматтер их все равно уберет

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убрала

const { t } = useTranslation();
const [email, setEmail] = useState('');
const [loading, setLoading] = useState(false);
const [success, setSuccess] = useState(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет обработки ошибки.

// Закрываем через 3 секунды
setTimeout(() => {
onClose();
setSuccess(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь не надо ставить false, это ведь не catch. Лучше перепиши это место на имитацию запроса с Promise.


export const ForgotPasswordModal: React.FC<ForgotPasswordModalProps> = ({ opened, onClose }) => {
const { t } = useTranslation();
const [email, setEmail] = useState('');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно сделать через форму

Suggested change
const [email, setEmail] = useState('');
const form = useForm({
email: '',
});

setLoading(true);

// ЗАГЛУШКА: Имитация отправки запроса
setTimeout(() => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setTimeout(() => {
form.post('/forgot', {
onError: (errs) => {
setRegError('Текст');
},
onSuccess: () => {
setSuccess(true);
},
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сейчас без бэка и MSW будет улетать в ошибку - ну и пусть.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants