From d5d29c1c929c0e199b52c01b26cb69cfe2e30199 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 20 Jun 2017 11:23:34 +0100 Subject: [PATCH 1/2] Give _t to PasswordNagBar, add CSS for UserSettings password warning Codep https://github.com/matrix-org/matrix-react-sdk/pull/1123 --- src/components/views/globals/PasswordNagBar.js | 10 +++++----- .../matrix-react-sdk/structures/_UserSettings.scss | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/views/globals/PasswordNagBar.js b/src/components/views/globals/PasswordNagBar.js index 37d011a605..56eb7bd761 100644 --- a/src/components/views/globals/PasswordNagBar.js +++ b/src/components/views/globals/PasswordNagBar.js @@ -20,6 +20,7 @@ import React from 'react'; import sdk from 'matrix-react-sdk'; import Modal from 'matrix-react-sdk/lib/Modal'; import dis from 'matrix-react-sdk/lib/dispatcher'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; export default React.createClass({ onUpdateClicked: function() { @@ -33,12 +34,11 @@ export default React.createClass({ dis.dispatch({ action: 'password_changed', }); - } + }, }); }, render: function() { - const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const toolbarClasses = "mx_MatrixToolbar mx_MatrixToolbar_clickable"; return (
@@ -49,12 +49,12 @@ export default React.createClass({ alt="Warning" />
- To return to your account in future you need to set a password + { _t("To return to your account in future you need to set a password") }
); - } + }, }); diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss b/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss index 9809a81ab1..7fa8ceb8c8 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_UserSettings.scss @@ -102,6 +102,19 @@ limitations under the License. padding-right: 1em; } +.mx_UserSettings_passwordWarning { + padding: 6px; + background-color: #76cfa6; + border-radius: 3px; + color: #fff; + margin-bottom: 5px; +} + +.mx_UserSettings_passwordWarning_icon { + vertical-align: -6px; + margin-right: 3px; +} + .mx_UserSettings_importExportButtons { padding-top: 10px; padding-left: 40px; From 047b255e144304858a6708792c6500ca876fcd4b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 20 Jun 2017 13:33:38 +0100 Subject: [PATCH 2/2] Add en_EN translations --- src/i18n/strings/en_EN.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4717e267ea..99b961a07a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -198,5 +198,7 @@ "Please set a password!": "Please set a password!", "This will allow you to return to your account after signing out, and sign in on other devices.": "This will allow you to return to your account after signing out, and sign in on other devices.", "You have successfully set a password and an email address!": "You have successfully set a password and an email address!", - "Remember, you can always set an email address in user settings if you change your mind.": "Remember, you can always set an email address in user settings if you change your mind." + "Remember, you can always set an email address in user settings if you change your mind.": "Remember, you can always set an email address in user settings if you change your mind.", + "To return to your account in future you need to set a password": "To return to your account in future you need to set a password", + "Set Password" }