Skip to content

Commit

Permalink
Revert ToolbarItem changes for the Whatsapp block
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeherve committed Feb 22, 2021
1 parent e9088c8 commit f0d2761
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
SelectControl,
Path,
ToggleControl,
ToolbarItem,
Button,
PanelBody,
ToolbarGroup,
Expand Down Expand Up @@ -148,17 +147,13 @@ export default function WhatsAppButtonConfiguration( { attributes, setAttributes
if ( context === 'toolbar' ) {
return (
<ToolbarGroup>
<ToolbarItem>
{ () => (
<Dropdown
position="bottom right"
className="jetpack-whatsapp-button-settings-selector"
contentClassName="jetpack-whatsapp-button__popover"
renderToggle={ ( { isOpen, onToggle } ) => renderSettingsToggle( isOpen, onToggle ) }
renderContent={ settings }
/>
) }
</ToolbarItem>
<Dropdown
position="bottom right"
className="jetpack-whatsapp-button-settings-selector"
contentClassName="jetpack-whatsapp-button__popover"
renderToggle={ ( { isOpen, onToggle } ) => renderSettingsToggle( isOpen, onToggle ) }
renderContent={ settings }
/>
</ToolbarGroup>
);
}
Expand Down

0 comments on commit f0d2761

Please sign in to comment.