diff --git a/res/css/views/auth/_AuthBody.scss b/res/css/views/auth/_AuthBody.scss index 21641978b6..d0df97a8e1 100644 --- a/res/css/views/auth/_AuthBody.scss +++ b/res/css/views/auth/_AuthBody.scss @@ -36,6 +36,12 @@ limitations under the License. color: $primary-fg-color; } +.mx_Auth_editServerDetails { + padding-left: 1em; + font-size: 12px; + font-weight: normal; +} + .mx_AuthBody a:link, .mx_AuthBody a:hover, .mx_AuthBody a:visited { diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index 8dd21c2d5c..64d35134f1 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -360,6 +360,14 @@ module.exports = React.createClass({ }); }, + onEditServerDetailsClick(ev) { + ev.preventDefault(); + ev.stopPropagation(); + this.setState({ + phase: PHASE_SERVER_DETAILS, + }); + }, + _tryWellKnownDiscovery: async function(serverName) { if (!serverName.trim()) { // Nothing to discover @@ -605,10 +613,20 @@ module.exports = React.createClass({ _renderPasswordStep: function() { const PasswordLogin = sdk.getComponent('auth.PasswordLogin'); + let onEditServerDetailsClick = null; + // If custom URLs are allowed and we haven't selected the Free server type, wire + // up the server details edit link. + if ( + !SdkConfig.get()['disable_custom_urls'] && + this.state.serverType !== ServerType.FREE + ) { + onEditServerDetailsClick = this.onEditServerDetailsClick; + } return ( + {_t('Edit')} + ; + } + const pwFieldClass = classNames({ mx_Login_field: true, error: this.props.loginIncorrect && !this.isLoginEmpty(), // only error password if error isn't top field @@ -289,7 +299,10 @@ class PasswordLogin extends React.Component { return (
-

{ yourMatrixAccountText }

+

+ {yourMatrixAccountText} + {editLink} +

{ loginType } { loginField }