From eb4b7c78a048b5ad2494e48ec6ab34c4d170bf52 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 25 Oct 2017 02:04:02 +0100 Subject: [PATCH] skin register screen --- .../structures/login/Registration.js | 46 +++++++++++------ .../views/login/RegistrationForm.js | 50 +++++++++++-------- 2 files changed, 59 insertions(+), 37 deletions(-) diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 8151c1e65c..15e6b536c4 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -26,6 +26,7 @@ import MatrixClientPeg from '../../../MatrixClientPeg'; import RegistrationForm from '../../views/login/RegistrationForm'; import RtsClient from '../../../RtsClient'; import { _t } from '../../../languageHandler'; +import UserSettingsStore from '../../../UserSettingsStore'; const MIN_PASSWORD_LENGTH = 6; @@ -327,6 +328,8 @@ module.exports = React.createClass({ const Spinner = sdk.getComponent("elements.Spinner"); const ServerConfig = sdk.getComponent('views.login.ServerConfig'); + const theme = UserSettingsStore.getTheme(); + let registerBody; if (this.state.doingUIAuth) { registerBody = ( @@ -345,9 +348,19 @@ module.exports = React.createClass({ } else if (this.state.busy || this.state.teamServerBusy) { registerBody = ; } else { - let errorSection; - if (this.state.errorText) { - errorSection =
{ this.state.errorText }
; + let serverConfigSection; + if (theme !== 'status') { + serverConfigSection = ( + + ); } registerBody = (
@@ -363,16 +376,7 @@ module.exports = React.createClass({ onRegisterClick={this.onFormSubmit} onTeamSelected={this.onTeamSelected} /> - { errorSection } - + { serverConfigSection }
); } @@ -385,6 +389,17 @@ module.exports = React.createClass({ ); } + + let header; + let errorText; + if (theme === 'status' && this.state.errorText) { + header =
{ this.state.errorText }
; + } + else { + header =

{ _t('Create an account') }

; + errorText =
{ this.state.errorText }
; + } + return (
@@ -394,11 +409,12 @@ module.exports = React.createClass({ this.state.teamSelected.domain + "/icon.png" : null} /> -

{ _t('Create an account') }

+ { header } { registerBody } - { _t('I already have an account') } + { theme === 'status' ? _t('Sign in') : _t('I already have an account') } + { errorText } { returnToAppJsx }
diff --git a/src/components/views/login/RegistrationForm.js b/src/components/views/login/RegistrationForm.js index 9c7c75b125..7574b68418 100644 --- a/src/components/views/login/RegistrationForm.js +++ b/src/components/views/login/RegistrationForm.js @@ -22,6 +22,7 @@ import Email from '../../../email'; import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; +import UserSettingsStore from '../../../UserSettingsStore'; const FIELD_EMAIL = 'field_email'; const FIELD_PHONE_COUNTRY = 'field_phone_country'; @@ -305,29 +306,34 @@ module.exports = React.createClass({ } } + const theme = UserSettingsStore.getTheme(); + const CountryDropdown = sdk.getComponent('views.login.CountryDropdown'); - const phoneSection = ( -
- - -
- ); + let phoneSection; + if (theme !== "status") { + phoneSection = ( +
+ + +
+ ); + } const registerButton = (