Skip to content

Commit

Permalink
BlockInspector: Remove unused 'showNoBlockSelectedMessage' prop (#68487)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
3 people authored Jan 5, 2025
1 parent 3416bf4 commit 4b39807
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

1 comment on commit 4b39807

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4b39807.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12617776691
📝 Reported issues:

Please sign in to comment.