From 9580ec72e3ef3c6949972fb4c1eb5bec9cdcd955 Mon Sep 17 00:00:00 2001
From: ErickSkrauch
Date: Tue, 17 May 2016 15:30:04 +0300
Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?=
=?UTF-8?q?=D0=B0=D0=BD=D1=8B=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B=20=D0=B2?=
=?UTF-8?q?=D0=BE=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?=
=?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../changePassword/ChangePassword.intl.json | 2 +-
.../forgotPassword/ForgotPasswordBody.jsx | 36 +++++++++++++------
.../auth/forgotPassword/forgotPassword.scss | 19 ++++++++++
.../recoverPassword/RecoverPassword.intl.json | 1 +
.../recoverPassword/RecoverPasswordBody.jsx | 7 ++--
.../auth/recoverPassword/recoverPassword.scss | 2 +-
src/i18n/en.json | 3 +-
src/i18n/ru.json | 3 +-
8 files changed, 55 insertions(+), 18 deletions(-)
diff --git a/src/components/auth/changePassword/ChangePassword.intl.json b/src/components/auth/changePassword/ChangePassword.intl.json
index 3770687..81afbdf 100644
--- a/src/components/auth/changePassword/ChangePassword.intl.json
+++ b/src/components/auth/changePassword/ChangePassword.intl.json
@@ -2,7 +2,7 @@
"changePasswordTitle": "Change password",
"changePasswordMessage": "To enhance the security of your account, please change your password.",
"skipThisStep": "Skip password changing",
- "change": "Change",
+ "change": "Change password",
"currentPassword": "Enter current password",
"newPassword": "Enter new password",
"newRePassword": "Repeat new password"
diff --git a/src/components/auth/forgotPassword/ForgotPasswordBody.jsx b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx
index daa6336..fae1612 100644
--- a/src/components/auth/forgotPassword/ForgotPasswordBody.jsx
+++ b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx
@@ -14,9 +14,22 @@ export default class ForgotPasswordBody extends BaseAuthBody {
static panelId = 'forgotPassword';
static hasGoBack = true;
+ state = {
+ isLoginEdit: !(this.context.user.email || this.context.user.username)
+ };
+
+ autoFocusField = this.state.isLoginEdit ? 'email' : null;
+
+ onClickEdit = () => {
+ this.setState({
+ isLoginEdit: true
+ });
+ };
+
render() {
const { user } = this.context;
- const login = user.email || user.username;
+ const login = user.email || user.username || '';
+ const isLoginEditShown = this.state.isLoginEdit;
// TODO: нужно парсить инфу о том, какой кд у отправки кода и во сколько точно можно будет повторить
@@ -28,16 +41,7 @@ export default class ForgotPasswordBody extends BaseAuthBody {
- {login ? (
-
- ) : (
+ {isLoginEditShown ? (
@@ -50,6 +54,16 @@ export default class ForgotPasswordBody extends BaseAuthBody {
defaultValue={login}
/>
+ ) : (
+
)}
);
diff --git a/src/components/auth/forgotPassword/forgotPassword.scss b/src/components/auth/forgotPassword/forgotPassword.scss
index 46bd2e1..96f8313 100644
--- a/src/components/auth/forgotPassword/forgotPassword.scss
+++ b/src/components/auth/forgotPassword/forgotPassword.scss
@@ -18,3 +18,22 @@
.login {
composes: email from 'components/auth/password/password.scss';
}
+
+.editLogin {
+ composes: pencil from 'components/ui/icons.scss';
+
+ position: relative;
+ bottom: 1px;
+ padding-left: 3px;
+
+ color: #666666;
+ font-size: 10px;
+
+ transition: color .3s;
+
+ cursor: pointer;
+
+ &:hover {
+ color: #ccc;
+ }
+}
diff --git a/src/components/auth/recoverPassword/RecoverPassword.intl.json b/src/components/auth/recoverPassword/RecoverPassword.intl.json
index 4743dc1..03bdb3b 100644
--- a/src/components/auth/recoverPassword/RecoverPassword.intl.json
+++ b/src/components/auth/recoverPassword/RecoverPassword.intl.json
@@ -1,6 +1,7 @@
{
"title": "Restore password",
"contactSupport": "Contact support",
+ "messageWasSent": "The recovery code was sent to your account email.",
"messageWasSentTo": "The recovery code was sent to your email {email}.",
"enterCodeBelow": "Please enter the code received into the field below:",
"enterNewPasswordBelow": "Enter and repeat new password below:",
diff --git a/src/components/auth/recoverPassword/RecoverPasswordBody.jsx b/src/components/auth/recoverPassword/RecoverPasswordBody.jsx
index 96a45d7..71d70d8 100644
--- a/src/components/auth/recoverPassword/RecoverPasswordBody.jsx
+++ b/src/components/auth/recoverPassword/RecoverPasswordBody.jsx
@@ -25,7 +25,6 @@ export default class RecoverPasswordBody extends BaseAuthBody {
autoFocusField = this.props.params && this.props.params.key ? 'newPassword' : 'key';
- // Если юзер вводил своё мыло во время попытки авторизации, то почему бы его сюда автоматически не подставить?
render() {
const {user} = this.context;
const {key} = this.props.params;
@@ -39,14 +38,16 @@ export default class RecoverPasswordBody extends BaseAuthBody {
{user.maskedEmail}
}} />
- ) : null}
+ ) : (
+
+ )}
{' '}