Skip to content

Commit b679fe7

Browse files
authored
Add shuffle style to write mode toolbar (#70946)
* Add shuffle style to content only toolbar * Only show shuffle icon if write mode is enabled * Limit shuffle section style block toolbar button to section blocks
1 parent 40fd0c6 commit b679fe7

File tree

1 file changed

+8
-2
lines changed
  • packages/block-editor/src/components/block-toolbar

1 file changed

+8
-2
lines changed

packages/block-editor/src/components/block-toolbar/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export function PrivateBlockToolbar( {
9191
getParentSectionBlock,
9292
isZoomOut,
9393
isNavigationMode: _isNavigationMode,
94+
isSectionBlock,
9495
} = unlock( select( blockEditorStore ) );
9596
const selectedBlockClientIds = getSelectedBlockClientIds();
9697
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
@@ -100,6 +101,7 @@ export function PrivateBlockToolbar( {
100101
const parentBlockName = getBlockName( parentClientId );
101102
const parentBlockType = getBlockType( parentBlockName );
102103
const editingMode = getBlockEditingMode( selectedBlockClientId );
104+
const isNavigationModeEnabled = _isNavigationMode();
103105
const _isDefaultEditingMode = editingMode === 'default';
104106
const _blockName = getBlockName( selectedBlockClientId );
105107
const isValid = selectedBlockClientIds.every( ( id ) =>
@@ -151,9 +153,13 @@ export function PrivateBlockToolbar( {
151153
showSlots: ! _isZoomOut,
152154
showGroupButtons: ! _isZoomOut,
153155
showLockButtons: ! _isZoomOut,
154-
showSwitchSectionStyleButton: _isZoomOut,
156+
showSwitchSectionStyleButton:
157+
_isZoomOut ||
158+
( isNavigationModeEnabled &&
159+
editingMode === 'contentOnly' &&
160+
isSectionBlock( selectedBlockClientId ) ), // Zoom out or Write Mode Section Blocks
155161
hasFixedToolbar: getSettings().hasFixedToolbar,
156-
isNavigationMode: _isNavigationMode(),
162+
isNavigationMode: isNavigationModeEnabled,
157163
};
158164
}, [] );
159165

0 commit comments

Comments
 (0)