Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation: Remove "Hide more settings" from block settings dropdown #46077

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
__experimentalRecursionProvider as RecursionProvider,
__experimentaluseLayoutClasses as useLayoutClasses,
__experimentaluseLayoutStyles as useLayoutStyles,
__unstableBlockNameContext,
} from '@wordpress/block-editor';
import { useEffect, useRef, useMemo } from '@wordpress/element';
import { Button, __unstableMotion as motion } from '@wordpress/components';
Expand Down Expand Up @@ -398,7 +399,14 @@ export default function VisualEditor( { styles } ) {
</motion.div>
<__unstableBlockSettingsMenuFirstItem>
{ ( { onClose } ) => (
<BlockInspectorButton onClick={ onClose } />
<__unstableBlockNameContext.Consumer>
{ ( blockName ) =>
blockName !== 'core/navigation-link' &&
blockName !== 'core/navigation-submenu' && (
<BlockInspectorButton onClick={ onClose } />
)
}
</__unstableBlockNameContext.Consumer>
) }
</__unstableBlockSettingsMenuFirstItem>
</BlockTools>
Expand Down
10 changes: 9 additions & 1 deletion packages/edit-site/src/components/block-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,17 @@ export default function BlockEditor( { setIsInserterOpen } ) {
</ResizableEditor>
<__unstableBlockSettingsMenuFirstItem>
{ ( { onClose } ) => (
<BlockInspectorButton onClick={ onClose } />
<__unstableBlockNameContext.Consumer>
{ ( blockName ) =>
blockName !== 'core/navigation-link' &&
blockName !== 'core/navigation-submenu' && (
<BlockInspectorButton onClick={ onClose } />
)
}
</__unstableBlockNameContext.Consumer>
) }
</__unstableBlockSettingsMenuFirstItem>

<__unstableBlockToolbarLastItem>
<__unstableBlockNameContext.Consumer>
{ ( blockName ) =>
Expand Down