Skip to content

Commit

Permalink
Spacing and adding extra condition for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Nov 21, 2024
1 parent 4a72c8d commit a2662df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -70,6 +72,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
selectedBlockName: _selectedBlockName,
blockType: _blockType,
isSectionBlock: _isSectionBlock( renderedBlockClientId ),
isNavigationMode: _isNavigationMode(),
};
}, [] );

Expand Down Expand Up @@ -166,6 +169,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
clientId={ selectedBlockClientId }
blockName={ blockType.name }
isSectionBlock={ isSectionBlock }
isNavigationMode={ isNavigationMode }
/>
</BlockInspectorSingleBlockWrapper>
);
Expand Down Expand Up @@ -211,6 +215,7 @@ const BlockInspectorSingleBlock = ( {
clientId,
blockName,
isSectionBlock,
isNavigationMode,
} ) => {
const availableTabs = useInspectorControlsTabs( blockName );
const showTabs = ! isSectionBlock && availableTabs?.length > 1;
Expand Down Expand Up @@ -276,7 +281,7 @@ const BlockInspectorSingleBlock = ( {
</PanelBody>
) }

{ ! isSectionBlock && (
{ ! isSectionBlock && ! isNavigationMode && (
<>
<InspectorControls.Slot />
<InspectorControls.Slot group="list" />
Expand Down Expand Up @@ -309,6 +314,10 @@ const BlockInspectorSingleBlock = ( {
</div>
</>
) }

{ isNavigationMode && (
<InspectorControls.Slot group="navigationMode" />
) }
</>
) }
<SkipToSelectedBlock key="back" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a2662df

Please sign in to comment.