From a2662dfcc38a3fe6757eb4ec6a307b6f709d13ce Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 21 Nov 2024 16:33:14 +1100 Subject: [PATCH] Spacing and adding extra condition for some reason --- .../src/components/block-inspector/index.js | 11 ++++++++++- .../src/query/edit/inspector-controls/index.js | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index 475d4f6a4b8c2e..cb0c09df60fb94 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -47,12 +47,14 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { selectedBlockClientId, blockType, isSectionBlock, + isNavigationMode, } = useSelect( ( select ) => { const { getSelectedBlockClientId, getSelectedBlockCount, getBlockName, getParentSectionBlock, + isNavigationMode: _isNavigationMode, isSectionBlock: _isSectionBlock, } = unlock( select( blockEditorStore ) ); const _selectedBlockClientId = getSelectedBlockClientId(); @@ -70,6 +72,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { selectedBlockName: _selectedBlockName, blockType: _blockType, isSectionBlock: _isSectionBlock( renderedBlockClientId ), + isNavigationMode: _isNavigationMode(), }; }, [] ); @@ -166,6 +169,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { clientId={ selectedBlockClientId } blockName={ blockType.name } isSectionBlock={ isSectionBlock } + isNavigationMode={ isNavigationMode } /> ); @@ -211,6 +215,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName, isSectionBlock, + isNavigationMode, } ) => { const availableTabs = useInspectorControlsTabs( blockName ); const showTabs = ! isSectionBlock && availableTabs?.length > 1; @@ -276,7 +281,7 @@ const BlockInspectorSingleBlock = ( { ) } - { ! isSectionBlock && ( + { ! isSectionBlock && ! isNavigationMode && ( <> @@ -309,6 +314,10 @@ const BlockInspectorSingleBlock = ( { ) } + + { isNavigationMode && ( + + ) } ) } diff --git a/packages/block-library/src/query/edit/inspector-controls/index.js b/packages/block-library/src/query/edit/inspector-controls/index.js index bcbd85ffe62114..7d5745e190c9a7 100644 --- a/packages/block-library/src/query/edit/inspector-controls/index.js +++ b/packages/block-library/src/query/edit/inspector-controls/index.js @@ -178,12 +178,14 @@ export default function QueryInspectorControls( props ) { showParentControl || showFormatControl; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); + const showPostCountControl = isControlAllowed( allowedControls, 'postCount' ); const showOffSetControl = isControlAllowed( allowedControls, 'offset' ); const showPagesControl = isControlAllowed( allowedControls, 'pages' ); + const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl;