Merge pull request #3989 from vector-im/luke/new-guest-access-set-pwd-dialog-fuzzy

Add warm-fuzzy for successful password entry
This commit is contained in:
David Baker 2017-05-22 16:15:00 +01:00 committed by GitHub
commit b057e8a92f

View file

@ -34,10 +34,17 @@ export default React.createClass({
getInitialState: function() {
return {
error: null,
success: false,
};
},
_onPasswordChanged: function() {
this.setState({
success: true,
});
},
_onContinueClicked: function() {
this.props.onFinished(true);
},
@ -58,6 +65,30 @@ export default React.createClass({
const ChangePassword = sdk.getComponent('views.settings.ChangePassword');
const Spinner = sdk.getComponent('elements.Spinner');
if (this.state.success) {
return (
<BaseDialog className="mx_SetPasswordDialog"
onFinished={this.props.onFinished}
title="You have successfully set a new password!"
>
<div className="mx_Dialog_content">
<p>
You can now return to your account after signing out,
and sign in on other devices.
</p>
</div>
<div className="mx_Dialog_buttons">
<button
className="mx_Dialog_primary"
autoFocus={true}
onClick={this._onContinueClicked}>
Continue
</button>
</div>
</BaseDialog>
);
}
return (
<BaseDialog className="mx_SetPasswordDialog"
onFinished={this.props.onFinished}