Skip to content

Commit

Permalink
Purchases: Change private registration cancellation button label to "…
Browse files Browse the repository at this point in the history
…Processing..." on click (Fixes #195)
  • Loading branch information
umurkontaci committed Nov 23, 2015
1 parent 29b02dd commit 8ad1d5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/me/purchases/cancel-private-registration/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import SimpleNotice from 'notices/simple-notice';
const CancelPrivateRegistration = React.createClass( {
getInitialState() {
return {
disabled: false
disabled: false,
cancelling: false
};
},

Expand All @@ -34,10 +35,14 @@ const CancelPrivateRegistration = React.createClass( {
const { domain, id } = this.props.selectedPurchase.data;

this.setState( {
disabled: true
disabled: true,
cancelling: true
} );

cancelPrivateRegistration( id, canceledSuccessfully => {
this.setState( {
cancelling: false
} );
if ( canceledSuccessfully ) {
page( paths.managePurchaseDestination( domain, id, 'canceled-private-registration' ) );
}
Expand Down Expand Up @@ -88,7 +93,7 @@ const CancelPrivateRegistration = React.createClass( {
onClick={ this.cancel }
className="cancel-private-registration__cancel-button"
disabled={ this.state.disabled }>
{ this.translate( 'Cancel Private Registration' ) }
{ this.state.cancelling ? this.translate( 'Processing…' ) : this.translate( 'Cancel Private Registration' ) }
</Button>
);
},
Expand Down

0 comments on commit 8ad1d5e

Please sign in to comment.