allow registration and login from guest to be cancellable

This commit is contained in:
Matthew Hodgson 2016-03-15 21:04:11 +00:00
parent f66dd69710
commit b7726d34d5
3 changed files with 59 additions and 5 deletions

View file

@ -42,6 +42,7 @@ module.exports = React.createClass({displayName: 'Login',
// login shouldn't care how password recovery is done.
onForgotPasswordClick: React.PropTypes.func,
onLoginAsGuestClick: React.PropTypes.func,
onCancelClick: React.PropTypes.func,
},
getInitialState: function() {
@ -211,6 +212,15 @@ module.exports = React.createClass({displayName: 'Login',
Login as guest
</a>
}
var returnToAppJsx;
if (this.props.onCancelClick) {
returnToAppJsx =
<a className="mx_Login_create" onClick={this.props.onCancelClick} href="#">
Return to app
</a>
}
return (
<div className="mx_Login">
<div className="mx_Login_box">
@ -235,6 +245,7 @@ module.exports = React.createClass({displayName: 'Login',
Create a new account
</a>
{ loginAsGuestJsx }
{ returnToAppJsx }
<LoginFooter />
</div>
</div>