Handle when no block was focused
This commit is contained in:
parent
cbda698e08
commit
63c629b14d
|
@ -1,3 +1,8 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
export function BlockInspector( {
|
||||
blockInfo: { blockName, templateBlockId, templateBlockOrder },
|
||||
}: {
|
||||
|
@ -9,6 +14,16 @@ export function BlockInspector( {
|
|||
} ) {
|
||||
return (
|
||||
<div className="woocommerce-product-editor-dev-tools-block-inspector">
|
||||
{ ! blockName && (
|
||||
<p>
|
||||
{ __(
|
||||
'Focus on a block to see its details.',
|
||||
'woocommerce'
|
||||
) }
|
||||
</p>
|
||||
) }
|
||||
|
||||
{ blockName && (
|
||||
<dl className="woocommerce-product-editor-dev-tools-block-inspector__properties">
|
||||
<dt>Block name</dt>
|
||||
<dd>{ blockName }</dd>
|
||||
|
@ -19,6 +34,7 @@ export function BlockInspector( {
|
|||
<dt>Template block order</dt>
|
||||
<dd>{ templateBlockOrder }</dd>
|
||||
</dl>
|
||||
) }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue