Add warm-fuzzy for successful password entry

pull/3989/head
Luke Barnard 2017-05-22 16:11:52 +01:00
parent 24584bee4a
commit 9fc57786f1
1 changed files with 31 additions and 0 deletions

View File

@ -34,10 +34,17 @@ export default React.createClass({
getInitialState: function() { getInitialState: function() {
return { return {
error: null, error: null,
success: false,
}; };
}, },
_onPasswordChanged: function() { _onPasswordChanged: function() {
this.setState({
success: true,
});
},
_onContinueClicked: function() {
this.props.onFinished(true); this.props.onFinished(true);
}, },
@ -58,6 +65,30 @@ export default React.createClass({
const ChangePassword = sdk.getComponent('views.settings.ChangePassword'); const ChangePassword = sdk.getComponent('views.settings.ChangePassword');
const Spinner = sdk.getComponent('elements.Spinner'); 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 ( return (
<BaseDialog className="mx_SetPasswordDialog" <BaseDialog className="mx_SetPasswordDialog"
onFinished={this.props.onFinished} onFinished={this.props.onFinished}