From f0d27619349a4d5022cda255beb4ae59920b12d6 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Mon, 22 Feb 2021 18:52:34 +0100 Subject: [PATCH] Revert ToolbarItem changes for the Whatsapp block Since that block has a set of tests, the tests need to be able to use ToolbarItem. If I update the version of @wordpress/components so it includes ToolbarItem, the tests pass, but the overall block build fails: ERROR in ./node_modules/@wp-g2/create-styles/node_modules/postcss/lib/map-generator.js Module not found: Error: Can't resolve 'path' in '.../jetpack/node_modules/@wp-g2/create-styles/node_modules/postcss/lib' Let's consequently hold off this change until @wordpress/components is properly updated in a separate PR: #16763. --- .../whatsapp-button/configuration.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/projects/plugins/jetpack/extensions/blocks/send-a-message/whatsapp-button/configuration.js b/projects/plugins/jetpack/extensions/blocks/send-a-message/whatsapp-button/configuration.js index 06a8f343ad38e..c1d578349c56c 100644 --- a/projects/plugins/jetpack/extensions/blocks/send-a-message/whatsapp-button/configuration.js +++ b/projects/plugins/jetpack/extensions/blocks/send-a-message/whatsapp-button/configuration.js @@ -10,7 +10,6 @@ import { SelectControl, Path, ToggleControl, - ToolbarItem, Button, PanelBody, ToolbarGroup, @@ -148,17 +147,13 @@ export default function WhatsAppButtonConfiguration( { attributes, setAttributes if ( context === 'toolbar' ) { return ( - - { () => ( - renderSettingsToggle( isOpen, onToggle ) } - renderContent={ settings } - /> - ) } - + renderSettingsToggle( isOpen, onToggle ) } + renderContent={ settings } + /> ); }