Skip to content

Commit

Permalink
Pass Buttons in as an array, to accurately trigger the `has-multiple-…
Browse files Browse the repository at this point in the history
…actions` class
  • Loading branch information
ryelle committed Feb 16, 2018
1 parent 6b5f005 commit bf39fd8
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions client/extensions/woocommerce/app/order/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Gridicon from 'gridicons';
import { isEmpty } from 'lodash';
import { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
import React, { Component, Fragment } from 'react';
import React, { Component } from 'react';

/**
* Internal dependencies
Expand Down Expand Up @@ -153,22 +153,20 @@ class OrderActionHeader extends Component {

renderEditingButtons = () => {
const { hasOrderEdits, isSaving, translate } = this.props;
return (
<Fragment>
<Button key="cancel" onClick={ this.cancelEditing }>
{ translate( 'Cancel' ) }
</Button>
<Button
key="save"
primary
onClick={ this.saveOrder }
busy={ isSaving }
disabled={ ! hasOrderEdits || isSaving }
>
{ translate( 'Update' ) }
</Button>
</Fragment>
);
return [
<Button key="cancel" onClick={ this.cancelEditing }>
{ translate( 'Cancel' ) }
</Button>,
<Button
key="save"
primary
onClick={ this.saveOrder }
busy={ isSaving }
disabled={ ! hasOrderEdits || isSaving }
>
{ translate( 'Update' ) }
</Button>,
];
};

render() {
Expand Down

0 comments on commit bf39fd8

Please sign in to comment.