Skip to content

Commit

Permalink
BlockInspector: Remove unused 'showNoBlockSelectedMessage' prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jan 4, 2025
1 parent 3416bf4 commit d555422
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
10 changes: 0 additions & 10 deletions packages/block-editor/src/components/block-inspector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ import { BlockInspector } from '@wordpress/block-editor';
const MyBlockInspector = () => <BlockInspector />;
```

### Props

#### showNoBlockSelectedMessage

Whether to display a "No block selected" message when no block is selected.

- Type: `boolean`
- Required: No
- Default: `true`

## Related components

Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [BlockEditorProvider](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
17 changes: 7 additions & 10 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function BlockStylesPanel( { clientId } ) {
);
}

const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
function BlockInspector() {
const {
count,
selectedBlockName,
Expand Down Expand Up @@ -137,14 +137,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
! selectedBlockClientId ||
isSelectedBlockUnregistered
) {
if ( showNoBlockSelectedMessage ) {
return (
<span className="block-editor-block-inspector__no-blocks">
{ __( 'No block selected.' ) }
</span>
);
}
return null;
return (
<span className="block-editor-block-inspector__no-blocks">
{ __( 'No block selected.' ) }
</span>
);
}

return (
Expand All @@ -168,7 +165,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
/>
</BlockInspectorSingleBlockWrapper>
);
};
}

const BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {
return animate ? wrapper( children ) : children;
Expand Down

0 comments on commit d555422

Please sign in to comment.