From 7a9f27ea49a8fb5aa641bc7d1f666ad89658aa7c Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 22 Feb 2018 10:08:02 -0700 Subject: [PATCH] =?UTF-8?q?Show=20just=20the=20button=20if=20this=20is=20a?= =?UTF-8?q?=20single=20button,=20or=20we=20don=E2=80=99t=20have=20a=20prim?= =?UTF-8?q?aryLabel=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../woocommerce/components/action-header/actions.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/extensions/woocommerce/components/action-header/actions.js b/client/extensions/woocommerce/components/action-header/actions.js index fad5d3724fd1db..18cccb7e048e9e 100644 --- a/client/extensions/woocommerce/components/action-header/actions.js +++ b/client/extensions/woocommerce/components/action-header/actions.js @@ -88,7 +88,13 @@ class ActionButtons extends Component { }; getDropdown = () => { + const isSingleButton = React.Children.count( this.props.children ) === 1; const primaryLabel = this.props.primaryLabel; + + if ( ! primaryLabel || isSingleButton ) { + return this.props.children; + } + const buttons = React.Children.toArray( this.props.children ); const primary = buttons.pop(); const dropdownOptions = buttons.map( function( child, index ) {