diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index cc8bc168..85f2a6cd 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -143,7 +143,7 @@ "Enter your new password": "Enter your new password", "Enter": "Enter", "Error": "Error", - "Everything is ok, please give us your email address": "It's okay, just enter your email address to receive a password reset link.", + "Please give us your email address": "Please provide us your email address to get the password reset link", "Experience": "Experience", "FAQ": "Tips and suggestions", "Favorite topics": "Favorite topics", @@ -157,7 +157,6 @@ "Follow": "Follow", "Followers": "Followers", "Following": "Following", - "Forgot password?": "Forgot your password?", "Forward": "Forward", "Full name": "First and last name", "Gallery name": "Gallery name", @@ -308,7 +307,6 @@ "Reports": "Reports", "Required": "Required", "Resend code": "Send confirmation", - "Restore password": "Restore password", "Rules of the journal Discours": "Rules of the journal Discours", "Save draft": "Save draft", "Save settings": "Save settings", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index 110a8495..bc783798 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -150,7 +150,7 @@ "Enter your new password": "Введите новый пароль", "Enter": "Войти", "Error": "Ошибка", - "Everything is ok, please give us your email address": "Ничего страшного, просто укажите свою почту, чтобы получить ссылку для сброса пароля.", + "Please give us your email address": "Пожалуйста, укажите свою почту, чтобы получить ссылку для сброса пароля", "Experience": "Личный опыт", "FAQ": "Советы и предложения", "Favorite topics": "Избранные темы", @@ -164,7 +164,6 @@ "Follow": "Подписаться", "Followers": "Подписчики", "Following": "Вы подписаны", - "Forgot password?": "Забыли пароль?", "Forward": "Переслать", "Full name": "Имя и фамилия", "Gallery name": "Название галереи", @@ -327,7 +326,7 @@ "Reports": "Репортажи", "Required": "Поле обязательно для заполнения", "Resend code": "Выслать подтверждение", - "Restore password": "Восстановить пароль", + "Set the new password": "Задать новый пароль", "Rules of the journal Discours": "Правила журнала Дискурс", "Save draft": "Сохранить черновик", "Save settings": "Сохранить настройки", @@ -343,7 +342,6 @@ "Self-publishing exists thanks to the help of wonderful people from all over the world. Thank you!": "Самиздат существуют благодаря помощи замечательных людей со всего мира. Спасибо Вам!", "Send link again": "Прислать ссылку ещё раз", "Send": "Отправить", - "Set the new password": "Задать новый пароль", "Settings": "Настройки", "Share publication": "Поделиться публикацией", "Share": "Поделиться", diff --git a/src/components/Nav/AuthModal/LoginForm.tsx b/src/components/Nav/AuthModal/LoginForm.tsx index 156feb6f..bbecdc48 100644 --- a/src/components/Nav/AuthModal/LoginForm.tsx +++ b/src/components/Nav/AuthModal/LoginForm.tsx @@ -55,7 +55,7 @@ export const LoginForm = () => { setIsLinkSent(true) setIsEmailNotConfirmed(false) setSubmitError('') - changeSearchParams({ mode: 'forgot-password' }) + changeSearchParams({ mode: 'send-reset-link' }) // NOTE: temporary solution, needs logic in authorizer /* FIXME: const { authorizer } = useSession() @@ -172,7 +172,7 @@ export const LoginForm = () => { class="link" onClick={() => changeSearchParams({ - mode: 'forgot-password', + mode: 'send-reset-link', }) } > diff --git a/src/components/Nav/AuthModal/RegisterForm.tsx b/src/components/Nav/AuthModal/RegisterForm.tsx index 09f4ecba..6b0b16f8 100644 --- a/src/components/Nav/AuthModal/RegisterForm.tsx +++ b/src/components/Nav/AuthModal/RegisterForm.tsx @@ -187,17 +187,16 @@ export const RegisterForm = () => { onBlur={handleEmailBlur} /> -
{validationErrors().email}
- + + {t('This email is')} {emailStatus() ? t(emailStatus()) : ''},{' '} + - {t('This email is')} {t(emailStatus())},{' '} changeSearchParams({ mode: 'login' })}> {t('enter')} - {t('This email is')} {t(emailStatus())},{' '} resendVerifyEmail({ email: email(), identifier: 'basic_signup' })} @@ -206,12 +205,11 @@ export const RegisterForm = () => { - {t('This email is')} {t(emailStatus())},{' '} changeSearchParams({ - mode: 'forgot-password', + mode: 'send-reset-link', }) } > diff --git a/src/components/Nav/AuthModal/ForgotPasswordForm.tsx b/src/components/Nav/AuthModal/SendResetLinkForm.tsx similarity index 92% rename from src/components/Nav/AuthModal/ForgotPasswordForm.tsx rename to src/components/Nav/AuthModal/SendResetLinkForm.tsx index 69250c32..b1880d9d 100644 --- a/src/components/Nav/AuthModal/ForgotPasswordForm.tsx +++ b/src/components/Nav/AuthModal/SendResetLinkForm.tsx @@ -18,7 +18,7 @@ type FormFields = { type ValidationErrors = Partial> -export const ForgotPasswordForm = () => { +export const SendResetLinkForm = () => { const { changeSearchParams } = useRouter() const { t } = useLocalize() const handleEmailInput = (newEmail: string) => { @@ -60,7 +60,7 @@ export const ForgotPasswordForm = () => { email: email(), redirect_uri: window.location.origin, }) - console.debug('[ForgotPasswordForm] authorizer response:', data) + console.debug('[SendResetLinkForm] authorizer response:', data) if (errors?.some((error) => error.message.includes('bad user credentials'))) { setIsUserNotFound(true) } @@ -79,10 +79,8 @@ export const ForgotPasswordForm = () => { ref={(el) => (authFormRef.current = el)} >
-

{t('Restore password')}

-
- {t(message()) || t('Everything is ok, please give us your email address')} -
+

{t('Set the new password')}

+
{t(message()) || t('Please give us your email address')}
{ disabled={isSubmitting() || Boolean(message())} type="submit" > - {isSubmitting() ? '...' : t('Restore password')} + {isSubmitting() ? '...' : t('Send')}
diff --git a/src/components/Nav/AuthModal/index.tsx b/src/components/Nav/AuthModal/index.tsx index c6b03ee8..760e58a0 100644 --- a/src/components/Nav/AuthModal/index.tsx +++ b/src/components/Nav/AuthModal/index.tsx @@ -11,16 +11,16 @@ import { isMobile } from '../../../utils/media-query' import { ChangePasswordForm } from './ChangePasswordForm' import { EmailConfirm } from './EmailConfirm' -import { ForgotPasswordForm } from './ForgotPasswordForm' import { LoginForm } from './LoginForm' import { RegisterForm } from './RegisterForm' +import { SendResetLinkForm } from './SendResetLinkForm' import styles from './AuthModal.module.scss' const AUTH_MODAL_MODES: Record = { login: LoginForm, register: RegisterForm, - 'forgot-password': ForgotPasswordForm, + 'send-reset-link': SendResetLinkForm, 'confirm-email': EmailConfirm, 'change-password': ChangePasswordForm, } diff --git a/src/components/Nav/AuthModal/types.ts b/src/components/Nav/AuthModal/types.ts index 92efe4ea..e2db3e78 100644 --- a/src/components/Nav/AuthModal/types.ts +++ b/src/components/Nav/AuthModal/types.ts @@ -1,4 +1,4 @@ -export type AuthModalMode = 'login' | 'register' | 'confirm-email' | 'forgot-password' | 'change-password' +export type AuthModalMode = 'login' | 'register' | 'confirm-email' | 'send-reset-link' | 'change-password' export type AuthModalSource = | 'discussions' | 'vote'