Skip to content

Commit

Permalink
Zoom Out: Hide slots and grouping buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 18, 2024
1 parent 2196966 commit 96dd858
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export function PrivateBlockToolbar( {
hasParentPattern,
hasContentOnlyLocking,
showShuffleButton,
showSlots,
showGroupButtons,
} = useSelect( ( select ) => {
const {
getBlockName,
Expand Down Expand Up @@ -135,6 +137,8 @@ export function PrivateBlockToolbar( {
hasParentPattern: _hasParentPattern,
hasContentOnlyLocking: _hasTemplateLock,
showShuffleButton: isZoomOut(),
showSlots: ! isZoomOut(),
showGroupButtons: ! isZoomOut(),
};
}, [] );

Expand Down Expand Up @@ -209,7 +213,8 @@ export function PrivateBlockToolbar( {
) }
{ ! hasContentOnlyLocking &&
shouldShowVisualToolbar &&
isMultiToolbar && <BlockGroupToolbar /> }
isMultiToolbar &&
showGroupButtons && <BlockGroupToolbar /> }
{ showShuffleButton && (
<ToolbarGroup>
<Shuffle
Expand All @@ -218,7 +223,7 @@ export function PrivateBlockToolbar( {
/>
</ToolbarGroup>
) }
{ shouldShowVisualToolbar && (
{ shouldShowVisualToolbar && showSlots && (
<>
<BlockControls.Slot
group="parent"
Expand Down

0 comments on commit 96dd858

Please sign in to comment.