-
Notifications
You must be signed in to change notification settings - Fork 150
Frontend: Создание компонента "Модальное окно для сброса пароля" #793 #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Прикрепи ссылку на задачу пожалуйста |
frontend/package.json
Outdated
| "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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а что он дает? сейчас скорость низкая?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот ссылка #793 Да я сейчас все переделываю, с учетом изменений на сегодняшний день. Смерджила основной репозиторий со своим, проект собрался и отображает страницу с новыми изменениями
There was a problem hiding this comment.
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"
| @@ -1,6 +1,11 @@ | |||
| <<<<<<< HEAD:frontend/src/Pages/Home.tsx | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
конфликты
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ты их точечно апала или они версии поднялись?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это у меня произошло
There was a problem hiding this comment.
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> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не надо этих новых строк, они ничего не дают + форматтер их все равно уберет
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно сделать через форму
| const [email, setEmail] = useState(''); | |
| const form = useForm({ | |
| email: '', | |
| }); |
| setLoading(true); | ||
|
|
||
| // ЗАГЛУШКА: Имитация отправки запроса | ||
| setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| setTimeout(() => { | |
| form.post('/forgot', { | |
| onError: (errs) => { | |
| setRegError('Текст'); | |
| }, | |
| onSuccess: () => { | |
| setSuccess(true); | |
| }, | |
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сейчас без бэка и MSW будет улетать в ошибку - ну и пусть.
Реализованы компоненты:
ForgotPasswordModal.tsx - модальное окно восстановления пароля
Header.tsx - интеграция модалки в хедер
Переводы (ru.ts / en.ts) - добавлены основные ключи