Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Navigation: Refactor overlay menu preview controls
  • Loading branch information
SainathPoojary committed Jun 2, 2025
commit 785bb92cb5de37aa8e4f2163febc4570cff713f4
29 changes: 16 additions & 13 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ import { useDispatch, useSelect } from '@wordpress/data';
import {
__experimentalToolsPanel as ToolsPanel,
__experimentalToolsPanelItem as ToolsPanelItem,
ToggleControl,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
__experimentalVStack as VStack,
ToggleControl,
Button,
Spinner,
Notice,
Expand Down Expand Up @@ -632,17 +633,20 @@ function Navigation( {
) }
</Button>
{ overlayMenuPreview && (
<div
<VStack
id={ overlayMenuPreviewId }
className="wp-block-navigation__overlay-menu-preview-controls"
spacing={ 4 }
style={ {
gridColumn: 'span 2',
} }
>
<OverlayMenuPreview
setAttributes={ setAttributes }
hasIcon={ hasIcon }
icon={ icon }
hidden={ ! overlayMenuPreview }
/>
</div>
</VStack>
) }
</>
) }
Expand Down Expand Up @@ -744,15 +748,14 @@ function Navigation( {
</ToolsPanelItem>

{ submenuAccessibilityNotice && (
<div className="wp-block-navigation__submenu-accessibility-notice">
<Notice
spokenMessage={ null }
status="warning"
isDismissible={ false }
>
{ submenuAccessibilityNotice }
</Notice>
</div>
<Notice
spokenMessage={ null }
status="warning"
isDismissible={ false }
className="wp-block-navigation__submenu-accessibility-notice"
>
{ submenuAccessibilityNotice }
</Notice>
) }
</>
) }
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
margin-bottom: 0;
}

.wp-block-navigation__overlay-menu-preview-controls {
grid-column: span 2;

.components-tools-panel-item:first-child {
margin-bottom: 16px;
}
}

.wp-block-navigation__submenu-accessibility-notice {
grid-column: span 2;
}
Loading