From d55542291b674e35fc8494f7e544d15629bf6a02 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Sat, 4 Jan 2025 11:28:54 +0400 Subject: [PATCH] BlockInspector: Remove unused 'showNoBlockSelectedMessage' prop --- .../src/components/block-inspector/README.md | 10 ---------- .../src/components/block-inspector/index.js | 17 +++++++---------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/packages/block-editor/src/components/block-inspector/README.md b/packages/block-editor/src/components/block-inspector/README.md index e6d7811ffe3a2..4c2fd2a06a61b 100644 --- a/packages/block-editor/src/components/block-inspector/README.md +++ b/packages/block-editor/src/components/block-inspector/README.md @@ -16,16 +16,6 @@ import { BlockInspector } from '@wordpress/block-editor'; const MyBlockInspector = () => ; ``` -### 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. diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index 450a370b5c212..3eee5438f1f44 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -39,7 +39,7 @@ function BlockStylesPanel( { clientId } ) { ); } -const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { +function BlockInspector() { const { count, selectedBlockName, @@ -137,14 +137,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { ! selectedBlockClientId || isSelectedBlockUnregistered ) { - if ( showNoBlockSelectedMessage ) { - return ( - - { __( 'No block selected.' ) } - - ); - } - return null; + return ( + + { __( 'No block selected.' ) } + + ); } return ( @@ -168,7 +165,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { /> ); -}; +} const BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => { return animate ? wrapper( children ) : children;