From bc3093d4d7218286b21e69a3505a8a334596d14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 7 Mar 2016 14:04:34 +0100 Subject: [PATCH] Whitelabel login form - also make some changes to signup form --- js/components/ascribe_forms/form_login.js | 8 +++++--- js/components/ascribe_forms/form_signup.js | 16 +++++----------- js/components/login_container.js | 9 +++++++-- js/components/signup_container.js | 7 ++++--- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js index 062b4709..2e04e450 100644 --- a/js/components/ascribe_forms/form_login.js +++ b/js/components/ascribe_forms/form_login.js @@ -22,7 +22,8 @@ let LoginForm = React.createClass({ propTypes: { headerMessage: React.PropTypes.string, submitMessage: React.PropTypes.string, - location: React.PropTypes.object + location: React.PropTypes.object, + whitelabelName: React.PropTypes.string }, mixins: [History], @@ -46,7 +47,8 @@ let LoginForm = React.createClass({ render() { const { headerMessage, location: { query: { email: emailQuery } }, - submitMessage } = this.props; + submitMessage, + whitelabelName } = this.props; return (
}>
-

{headerMessage}

+

{whitelabelName ? `Welcome to ${whitelabelName}` : headerMessage}

+ label={getLangText('Password')}> + label={getLangText('Confirm Password')}> - +
- {getLangText('Not an ascribe user')}? {getLangText('Sign up')}...
+ {getLangText(`Not a ${whitelabelName || 'ascribe'} user`)}? {getLangText('Sign up')}...
{getLangText('Forgot my password')}? {getLangText('Rescue me')}...
diff --git a/js/components/signup_container.js b/js/components/signup_container.js index 8585cfb1..7fea7ff5 100644 --- a/js/components/signup_container.js +++ b/js/components/signup_container.js @@ -34,7 +34,8 @@ let SignupContainer = React.createClass({ }, render() { - const { location, whitelabel } = this.props; + const { location, + whitelabel: { name: whitelabelName } } = this.props; const { message, submitted } = this.state; setDocumentTitle(getLangText('Sign up')); @@ -53,10 +54,10 @@ let SignupContainer = React.createClass({
- {getLangText(`Already a ${whitelabel.name || 'ascribe'} user`)}? {getLangText('Log in')}...
+ {getLangText(`Already a ${whitelabelName || 'ascribe'} user`)}? {getLangText('Log in')}...