Skip to content

Commit

Permalink
Block Editor: Remove the Shuffle block toolbar button (#64954)
Browse files Browse the repository at this point in the history
* Block Editor: Remove the Shuffle block toolbar button
* Remove unused 'rootClientId' selection

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: cbravobernal <[email protected]>
Co-authored-by: annezazu <[email protected]>
  • Loading branch information
4 people authored Sep 3, 2024
1 parent dcfddbe commit a4f0acf
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { useShowHoveredOrFocusedGestures } from './utils';
import { store as blockEditorStore } from '../../store';
import __unstableBlockNameContext from './block-name-context';
import NavigableToolbar from '../navigable-toolbar';
import Shuffle from './shuffle';
import { useHasBlockToolbar } from './use-has-block-toolbar';

/**
Expand Down Expand Up @@ -66,22 +65,18 @@ export function PrivateBlockToolbar( {
shouldShowVisualToolbar,
showParentSelector,
isUsingBindings,
canRemove,
} = useSelect( ( select ) => {
const {
getBlockName,
getBlockMode,
getBlockParents,
getSelectedBlockClientIds,
isBlockValid,
getBlockRootClientId,
getBlockEditingMode,
getBlockAttributes,
canRemoveBlock,
} = select( blockEditorStore );
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlockClientId = selectedBlockClientIds[ 0 ];
const blockRootClientId = getBlockRootClientId( selectedBlockClientId );
const parents = getBlockParents( selectedBlockClientId );
const firstParentClientId = parents[ parents.length - 1 ];
const parentBlockName = getBlockName( firstParentClientId );
Expand All @@ -106,7 +101,6 @@ export function PrivateBlockToolbar( {
isDefaultEditingMode: _isDefaultEditingMode,
blockType: selectedBlockClientId && getBlockType( _blockName ),
shouldShowVisualToolbar: isValid && isVisual,
rootClientId: blockRootClientId,
toolbarKey: `${ selectedBlockClientId }${ firstParentClientId }`,
showParentSelector:
parentBlockType &&
Expand All @@ -119,7 +113,6 @@ export function PrivateBlockToolbar( {
selectedBlockClientIds.length === 1 &&
_isDefaultEditingMode,
isUsingBindings: _isUsingBindings,
canRemove: canRemoveBlock( selectedBlockClientId ),
};
}, [] );

Expand Down Expand Up @@ -202,9 +195,6 @@ export function PrivateBlockToolbar( {
</ToolbarGroup>
</div>
) }
{ ! isMultiToolbar && canRemove && (
<Shuffle clientId={ blockClientId } />
) }
{ shouldShowVisualToolbar && isMultiToolbar && (
<BlockGroupToolbar />
) }
Expand Down

0 comments on commit a4f0acf

Please sign in to comment.