From fa21608801f8d2ef710d4c28abbb558883afeaf7 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Mon, 20 Feb 2017 14:37:37 -0300 Subject: [#907] Translate auth error message on login with @anikarni --- web-ui/src/login/app.js | 24 +++++++++++++++++------- web-ui/src/login/app.scss | 39 +++++++++++++++++++++++++++++++++++++++ web-ui/src/login/login.css | 33 +++------------------------------ web-ui/src/login/login.html | 6 +----- web-ui/src/login/login.js | 3 ++- web-ui/src/util.js | 7 +++++++ 6 files changed, 69 insertions(+), 43 deletions(-) create mode 100644 web-ui/src/util.js (limited to 'web-ui/src') diff --git a/web-ui/src/login/app.js b/web-ui/src/login/app.js index ee5a7652..07099c60 100644 --- a/web-ui/src/login/app.js +++ b/web-ui/src/login/app.js @@ -22,16 +22,26 @@ import SubmitButton from 'src/common/submit_button/submit_button'; import './app.scss'; -export const App = ({ t }) => ( -
- - - - +const errorMessage = (t, authError) => { + if (authError) return

{t('error.auth')}

; + return
; +}; + +export const App = ({ t, authError }) => ( +
+ Pixelated logo + {errorMessage(t, authError)} +
+ + + + +
); App.propTypes = { - t: React.PropTypes.func.isRequired + t: React.PropTypes.func.isRequired, + authError: React.PropTypes.bool }; export default translate('', { wait: true })(App); diff --git a/web-ui/src/login/app.scss b/web-ui/src/login/app.scss index 76390cb7..f971750f 100644 --- a/web-ui/src/login/app.scss +++ b/web-ui/src/login/app.scss @@ -15,16 +15,55 @@ * along with Pixelated. If not, see . */ + +.error { + color: #D72A25; + margin: 10px 0 0 0; +} + +.login { + display: block; + width: 90%; + margin: auto; + max-width: 400px; + padding: 2em 0; + margin-top: 3%; + margin-bottom: 3%; + background-color: #FFF; + display: flex; + flex-direction: column; + align-items: center; +} + #login_form { padding: 20px 0; + width: 70%; .input-field-group { width: 100%; } + + .submit-button { + width: 100%; + } +} + +.logo { + width: 70%; } @media only screen and (min-width : 500px) { #login_form .input-field-group { margin-top: 1em; } + + .login { + width: 60%; + } +} + +@media only screen and (min-width : 960px) { + .login { + width: 40%; + } } diff --git a/web-ui/src/login/login.css b/web-ui/src/login/login.css index bbb37443..d1206a39 100644 --- a/web-ui/src/login/login.css +++ b/web-ui/src/login/login.css @@ -25,29 +25,6 @@ body { background-repeat: repeat; } -.error { - color: #D72A25; - margin: 10px 0 0 0; -} - -.login { - display: block; - width: 90%; - margin: auto; - max-width: 400px; - padding: 2em 0; - margin-top: 3%; - margin-bottom: 3%; - background-color: #FFF; - display: flex; - flex-direction: column; - align-items: center; -} - -#root { - width: 70%; -} - .disclaimer { display: block; width: 90%; @@ -68,22 +45,18 @@ body { margin-top: 1em; } -.logo { - width: 70%; -} - @media only screen and (min-width : 500px) { body { - font-size: 1.3em; + font-size: 1.2em; } - .login, .disclaimer { + .disclaimer { width: 60%; } } @media only screen and (min-width : 960px) { - .login, .disclaimer { + .disclaimer { width: 40%; } } diff --git a/web-ui/src/login/login.html b/web-ui/src/login/login.html index 40593096..3cebf6f4 100644 --- a/web-ui/src/login/login.html +++ b/web-ui/src/login/login.html @@ -12,11 +12,7 @@
-