diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index bdcc641391..8a2714d96a 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -24,7 +24,6 @@ import Modal from "../../../Modal"; import MatrixClientPeg from "../../../MatrixClientPeg"; import PasswordReset from "../../../PasswordReset"; -import UserSettingsStore from "../../../UserSettingsStore"; module.exports = React.createClass({ displayName: 'ForgotPassword', @@ -184,10 +183,8 @@ module.exports = React.createClass({ ); } else { - let theme = UserSettingsStore.getTheme(); - let serverConfigSection; - if (theme !== 'status') { + if (!config.disable_custom_urls) { serverConfigSection = ( -
Incorrect username and/or password.
-
Please note you are logging into the matrix.status.im server, not matrix.org.
+
{ _t('Incorrect username and/or password.') }
+
+ { _t('Please note you are logging into the %(hs)s server, not matrix.org.', + { + hs: this.props.defaultHsUrl.replace(/^https?:\/\//, '') + }) + } +
); } else { @@ -345,10 +351,8 @@ module.exports = React.createClass({ const ServerConfig = sdk.getComponent("login.ServerConfig"); const loader = this.state.busy ?
: null; - const theme = UserSettingsStore.getTheme(); - let loginAsGuestJsx; - if (this.props.enableGuest && theme !== 'status') { + if (this.props.enableGuest) { loginAsGuestJsx = { _t('Login as guest') } @@ -366,9 +370,7 @@ module.exports = React.createClass({ } */ - let serverConfig; - let header; - if (theme !== 'status') { + if (!SdkConfig.get().disable_custom_urls) { serverConfig = ; + } + let serverConfig; + let header; + + // FIXME: remove status.im theme tweaks + const theme = UserSettingsStore.getTheme(); + if (theme !== "status") { header =

{ _t('Sign in') }

; } else { @@ -409,7 +418,7 @@ module.exports = React.createClass({
{ loginAsGuestJsx } { returnToAppJsx } - { theme !== 'status' ? this._renderLanguageSetting() : '' } + { !SdkConfig.get().disable_login_language_selector ? this._renderLanguageSetting() : '' } diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 2403610416..910d81ec33 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -27,6 +27,7 @@ import RegistrationForm from '../../views/login/RegistrationForm'; import RtsClient from '../../../RtsClient'; import { _t } from '../../../languageHandler'; import UserSettingsStore from '../../../UserSettingsStore'; +import SdkConfig from '../../../SdkConfig'; const MIN_PASSWORD_LENGTH = 6; @@ -351,7 +352,7 @@ module.exports = React.createClass({ registerBody = ; } else { let serverConfigSection; - if (theme !== 'status') { + if (!SdkConfig.get().disable_custom_urls) { serverConfigSection = ( { this.state.errorText }; } diff --git a/src/components/views/login/LoginPage.js b/src/components/views/login/LoginPage.js index b5e2faedec..b971ecd1df 100644 --- a/src/components/views/login/LoginPage.js +++ b/src/components/views/login/LoginPage.js @@ -24,6 +24,7 @@ module.exports = React.createClass({ displayName: 'LoginPage', render: function() { + // FIXME: this should be turned into a proper skin with a StatusLoginPage component if (UserSettingsStore.getTheme() === 'status') { return (
diff --git a/src/components/views/login/PasswordLogin.js b/src/components/views/login/PasswordLogin.js index 8af148dc6c..77b695ef12 100644 --- a/src/components/views/login/PasswordLogin.js +++ b/src/components/views/login/PasswordLogin.js @@ -20,7 +20,7 @@ import classNames from 'classnames'; import sdk from '../../../index'; import { _t } from '../../../languageHandler'; import {field_input_incorrect} from '../../../UiEffects'; -import UserSettingsStore from '../../../UserSettingsStore'; +import SdkConfig from '../../../SdkConfig'; /** * A pure UI component which displays a username/password form. @@ -122,8 +122,6 @@ class PasswordLogin extends React.Component { mx_Login_field_disabled: disabled, }; - const theme = UserSettingsStore.getTheme(); - switch(loginType) { case PasswordLogin.LOGIN_FIELD_EMAIL: classes.mx_Login_email = true; @@ -146,7 +144,10 @@ class PasswordLogin extends React.Component { type="text" name="username" // make it a little easier for browser's remember-password onChange={this.onUsernameChanged} - placeholder={theme === 'status' ? "Username on matrix.status.im" : _t("User name")} + placeholder={ SdkConfig.get().disable_custom_urls ? + _t("Username on %(hs)s", { + hs: this.props.hsUrl.replace(/^https?:\/\//, '') + }) : _t("User name")} value={this.state.username} autoFocus disabled={disabled} @@ -212,9 +213,8 @@ class PasswordLogin extends React.Component { const loginField = this.renderLoginField(this.state.loginType, matrixIdText === ''); - const theme = UserSettingsStore.getTheme(); let loginType; - if (theme !== 'status') { + if (!SdkConfig.get().disable_3pid_login) { loginType = (
diff --git a/src/components/views/login/RegistrationForm.js b/src/components/views/login/RegistrationForm.js index 426cc41dea..5ba93ec272 100644 --- a/src/components/views/login/RegistrationForm.js +++ b/src/components/views/login/RegistrationForm.js @@ -23,6 +23,7 @@ import { looksValid as phoneNumberLooksValid } from '../../../phonenumber'; import Modal from '../../../Modal'; import { _t } from '../../../languageHandler'; import UserSettingsStore from '../../../UserSettingsStore'; +import SdkConfig from '../../../SdkConfig'; const FIELD_EMAIL = 'field_email'; const FIELD_PHONE_COUNTRY = 'field_phone_country'; @@ -275,6 +276,7 @@ module.exports = React.createClass({ const self = this; const theme = UserSettingsStore.getTheme(); + // FIXME: remove hardcoded Status team tweaks at some point const emailPlaceholder = theme === 'status' ? _t("Email address") : _t("Email address (optional)"); const emailSection = ( @@ -311,7 +313,7 @@ module.exports = React.createClass({ const CountryDropdown = sdk.getComponent('views.login.CountryDropdown'); let phoneSection; - if (theme !== "status") { + if (!SdkConfig.get().disable_3pid_login) { phoneSection = (