fix up registration page too

This commit is contained in:
Matthew Hodgson 2015-07-19 03:30:41 +01:00
parent d239070adb
commit 2d25414b57
3 changed files with 15 additions and 18 deletions

View file

@ -70,7 +70,7 @@ limitations under the License.
opacity: 0.8; opacity: 0.8;
} }
.mx_Login_advanced_checkbox { .mx_Login_checkbox {
margin-right: 10px; margin-right: 10px;
} }

View file

@ -106,12 +106,10 @@ module.exports = React.createClass({
switch (step) { switch (step) {
case 'choose_hs': case 'choose_hs':
var serverConfigStyle = {}; var serverConfigStyle = {};
if (!this.state.serverConfigVisible) { serverConfigStyle.display = this.state.serverConfigVisible ? 'block' : 'none';
serverConfigStyle.display = 'none';
}
return ( return (
<div> <div>
<input className="mx_Login_advanced_checkbox" id="advanced" type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} /> <input className="mx_Login_checkbox" id="advanced" type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} />
<label className="mx_Login_label" htmlFor="advanced">Use custom server options (advanced)</label> <label className="mx_Login_label" htmlFor="advanced">Use custom server options (advanced)</label>
<div style={serverConfigStyle}> <div style={serverConfigStyle}>
<ServerConfig ref="serverConfig" <ServerConfig ref="serverConfig"

View file

@ -76,6 +76,7 @@ module.exports = React.createClass({
}, },
getUserIdSuffix: function() { getUserIdSuffix: function() {
return '';
var actualHsUrl = document.createElement('a'); var actualHsUrl = document.createElement('a');
actualHsUrl.href = this.getHsUrl(); actualHsUrl.href = this.getHsUrl();
var defaultHsUrl = document.createElement('a'); var defaultHsUrl = document.createElement('a');
@ -96,26 +97,24 @@ module.exports = React.createClass({
switch (step) { switch (step) {
case 'initial': case 'initial':
var serverConfigStyle = {}; var serverConfigStyle = {};
if (!this.state.serverConfigVisible) { serverConfigStyle.display = this.state.serverConfigVisible ? 'block' : 'none';
serverConfigStyle.display = 'none';
}
return ( return (
<div> <div>
<form onSubmit={this.onInitialStageSubmit}> <form onSubmit={this.onInitialStageSubmit}>
Email: <input type="text" ref="email" defaultValue={this.savedParams.email} /><br /> <input className="mx_Login_field" type="text" ref="email" placeholder="Email address" defaultValue={this.savedParams.email} /><br />
Username: <input type="text" ref="username" defaultValue={this.savedParams.username} />{this.getUserIdSuffix()}<br /> <input className="mx_Login_field" type="text" ref="username" placeholder="User name" defaultValue={this.savedParams.username} />{this.getUserIdSuffix()}<br />
Password: <input type="password" ref="password" defaultValue={this.savedParams.password} /><br /> <input className="mx_Login_field" type="password" ref="password" placeholder="Password" defaultValue={this.savedParams.password} /><br />
Confirm Password: <input type="password" ref="confirmPassword" defaultValue={this.savedParams.confirmPassword} /><br /> <input className="mx_Login_field" type="password" ref="confirmPassword" placeholder="Confirm password" defaultValue={this.savedParams.confirmPassword} /><br />
<input type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} /> <input className="mx_Login_checkbox" id="advanced" type="checkbox" value={this.state.serverConfigVisible} onChange={this.onServerConfigVisibleChange} />
Use custom server options (advanced) <label for="advanced">Use custom server options (advanced)</label>
<div style={serverConfigStyle}> <div style={serverConfigStyle}>
<ServerConfig ref="serverConfig" <ServerConfig ref="serverConfig"
defaultHsUrl={this.customHsUrl} defaultIsUrl={this.customIsUrl} defaultHsUrl={this.customHsUrl} defaultIsUrl={this.customIsUrl}
onHsUrlChanged={this.onServerUrlChanged} onIsUrlChanged={this.onServerUrlChanged} /> onHsUrlChanged={this.onServerUrlChanged} onIsUrlChanged={this.onServerUrlChanged} />
</div> </div>
<br /> <br />
<input type="submit" value="Continue" /> <input className="mx_Login_submit" type="submit" value="Register" />
</form> </form>
</div> </div>
); );
@ -144,10 +143,10 @@ module.exports = React.createClass({
} else { } else {
return ( return (
<div> <div>
<h1>Create an account</h1> <h2>Create an account</h2>
{this.componentForStep(this.state.step)} {this.componentForStep(this.state.step)}
<div className="error">{this.state.errorText}</div> <div className="mx_Login_error">{this.state.errorText}</div>
<a onClick={this.showLogin} href="#">I already have an account</a> <a className="mx_Login_create" onClick={this.showLogin} href="#">I already have an account</a>
</div> </div>
); );
} }