From 4c7ffa77f956a5753b97077ef3c55bfc362a3b96 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 17 May 2016 00:23:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D1=82=D1=8F=D0=BD=D1=83?= =?UTF-8?q?=D1=82=20=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8=D0=B9=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BA=D0=BE=D0=B4=D0=B0?= =?UTF-8?q?=20=D0=BE=20=D0=B2=D0=BE=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BE=D1=82=20=D0=B0=D0=BA=D0=BA=D0=B0=D1=83?= =?UTF-8?q?=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../forgotPassword/ForgotPassword.intl.json | 2 +- .../forgotPassword/ForgotPasswordBody.jsx | 45 ++++++++++++------- .../auth/forgotPassword/forgotPassword.scss | 12 +++++ src/i18n/en.json | 4 +- src/i18n/ru.json | 4 +- src/services/errorsDict.intl.json | 2 +- 6 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/components/auth/forgotPassword/ForgotPassword.intl.json b/src/components/auth/forgotPassword/ForgotPassword.intl.json index 31b8232..c4eb5be 100644 --- a/src/components/auth/forgotPassword/ForgotPassword.intl.json +++ b/src/components/auth/forgotPassword/ForgotPassword.intl.json @@ -1,7 +1,7 @@ { "title": "Forgot password", "sendMail": "Send mail", - "specifyEmail": "Specify the registration E-mail address for your account and we will send an email with instructions for further password recovery.", + "specifyEmail": "Specify the registration E-mail address or last used username for your account and we will send an email with instructions for further password recovery.", "pleasePressButton": "Please press the button bellow to get an email with password recovery code.", "alreadyHaveCode": "Already have a code" } diff --git a/src/components/auth/forgotPassword/ForgotPasswordBody.jsx b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx index ef621ed..daa6336 100644 --- a/src/components/auth/forgotPassword/ForgotPasswordBody.jsx +++ b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx @@ -3,6 +3,7 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Input } from 'components/ui/form'; +import icons from 'components/ui/icons.scss'; import BaseAuthBody from 'components/auth/BaseAuthBody'; import styles from './forgotPassword.scss'; @@ -14,28 +15,42 @@ export default class ForgotPasswordBody extends BaseAuthBody { static hasGoBack = true; render() { - const {user} = this.context; - const hasIdentity = user.email || user.username; - const message = hasIdentity ? messages.pleasePressButton : messages.specifyEmail; + const { user } = this.context; + const login = user.email || user.username; + + // TODO: нужно парсить инфу о том, какой кд у отправки кода и во сколько точно можно будет повторить return (
{this.renderErrors()} -

- -

+
+ +
- {hasIdentity ? null : ( - + {login ? ( +
+
+ {login} +
+

+ +

+
+ ) : ( +
+

+ +

+ +
)} -
); } diff --git a/src/components/auth/forgotPassword/forgotPassword.scss b/src/components/auth/forgotPassword/forgotPassword.scss index fcf5777..46bd2e1 100644 --- a/src/components/auth/forgotPassword/forgotPassword.scss +++ b/src/components/auth/forgotPassword/forgotPassword.scss @@ -6,3 +6,15 @@ padding-bottom: 8px; color: #aaa; } + +// TODO: вынести иконки такого типа в какую-то внешнюю структуру? +.bigIcon { + color: #ccc; + font-size: 100px; + line-height: 1; + margin-bottom: 15px; +} + +.login { + composes: email from 'components/auth/password/password.scss'; +} diff --git a/src/i18n/en.json b/src/i18n/en.json index f8e65fa..abdb21a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -29,7 +29,7 @@ "components.auth.forgotPassword.alreadyHaveCode": "Already have a code", "components.auth.forgotPassword.pleasePressButton": "Please press the button bellow to get an email with password recovery code.", "components.auth.forgotPassword.sendMail": "Send mail", - "components.auth.forgotPassword.specifyEmail": "Specify the registration E-mail address for your account and we will send an email with instructions for further password recovery.", + "components.auth.forgotPassword.specifyEmail": "Specify the registration E-mail address or last used username for your account and we will send an email with instructions for further password recovery.", "components.auth.forgotPassword.title": "Forgot password", "components.auth.login.emailOrUsername": "E-mail or username", "components.auth.login.loginTitle": "Sign in", @@ -94,7 +94,7 @@ "register": "Join", "sendEmailButton": "Send E-mail", "services.accountNotActivated": "The account is not activated", - "services.emailFrequency": "Please cool down, you are requesting emails too often", + "services.emailFrequency": "Please cool down, you are requesting emails too often. New key can be retrieved after 30 minutes from the previous request.", "services.emailInvalid": "Email is invalid", "services.emailIsTempmail": "Tempmail E-mail addresses is not allowed", "services.emailNotAvailable": "This email is already registered.", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index a515644..545b27d 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -29,7 +29,7 @@ "components.auth.forgotPassword.alreadyHaveCode": "Already have a code", "components.auth.forgotPassword.pleasePressButton": "Please press the button bellow to get an email with password recovery code.", "components.auth.forgotPassword.sendMail": "Send mail", - "components.auth.forgotPassword.specifyEmail": "Specify the registration E-mail address for your account and we will send an email with instructions for further password recovery.", + "components.auth.forgotPassword.specifyEmail": "Specify the registration E-mail address or last used username for your account and we will send an email with instructions for further password recovery.", "components.auth.forgotPassword.title": "Forgot password", "components.auth.login.emailOrUsername": "E-mail or username", "components.auth.login.loginTitle": "Sign in", @@ -94,7 +94,7 @@ "register": "Join", "sendEmailButton": "Send E-mail", "services.accountNotActivated": "The account is not activated", - "services.emailFrequency": "Please cool down, you are requesting emails too often", + "services.emailFrequency": "Please cool down, you are requesting emails too often. New key can be retrieved after 30 minutes from the previous request.", "services.emailInvalid": "Email is invalid", "services.emailIsTempmail": "Tempmail E-mail addresses is not allowed", "services.emailNotAvailable": "This email is already registered.", diff --git a/src/services/errorsDict.intl.json b/src/services/errorsDict.intl.json index c101548..f31eb46 100644 --- a/src/services/errorsDict.intl.json +++ b/src/services/errorsDict.intl.json @@ -23,6 +23,6 @@ "rulesAgreementRequired": "You must accept rules in order to create an account", "keyRequired": "Please, enter an activation key", "keyNotExists": "The key is incorrect", - "emailFrequency": "Please cool down, you are requesting emails too often", + "emailFrequency": "Please cool down, you are requesting emails too often. New key can be retrieved after 30 minutes from the previous request.", "accountNotActivated": "The account is not activated" }