diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index 50785917a1..ca2d7716a9 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -323,6 +323,14 @@ module.exports = React.createClass({ }); }, + onEditServerDetailsClick(ev) { + ev.preventDefault(); + ev.stopPropagation(); + this.setState({ + phase: PHASE_SERVER_DETAILS, + }); + }, + _makeRegisterRequest: function(auth) { // Only send the bind params if we're sending username / pw params // (Since we need to send no params at all to use the ones saved in the @@ -440,6 +448,16 @@ module.exports = React.createClass({ } else if (this.state.busy || !this.state.flows) { return ; } else { + 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 ( + PHASES_ENABLED && + !SdkConfig.get()['disable_custom_urls'] && + this.state.serverType !== ServerType.FREE + ) { + onEditServerDetailsClick = this.onEditServerDetailsClick; + } return ?Promise + onEditServerDetailsClick: PropTypes.func, flows: PropTypes.arrayOf(PropTypes.object).isRequired, }, @@ -272,6 +273,15 @@ module.exports = React.createClass({ } } + let editLink = null; + if (this.props.onEditServerDetailsClick) { + editLink = + {_t('Edit')} + ; + } + const emailPlaceholder = this._authStepIsRequired('m.login.email.identity') ? _t("Email address") : _t("Email address (optional)"); @@ -325,7 +335,10 @@ module.exports = React.createClass({ return (
-

{yourMatrixAccountText}

+

+ {yourMatrixAccountText} + {editLink} +

{ emailSection } { phoneSection }