Skip to content

Commit

Permalink
Navigation: Hide overlay preview settings when the overlay is off (#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Sep 9, 2022
1 parent a62506f commit 0ac7078
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,32 +484,36 @@ function Navigation( {
{ hasSubmenuIndicatorSetting && (
<PanelBody title={ __( 'Display' ) }>
{ isResponsive && (
<Button
className={ overlayMenuPreviewClasses }
onClick={ () => {
setOverlayMenuPreview( ! overlayMenuPreview );
} }
>
{ hasIcon && (
<>
<OverlayMenuIcon icon={ icon } />
<Icon icon={ close } />
</>
) }
{ ! hasIcon && (
<>
<span>{ __( 'Menu' ) }</span>
<span>{ __( 'Close' ) }</span>
</>
<>
<Button
className={ overlayMenuPreviewClasses }
onClick={ () => {
setOverlayMenuPreview(
! overlayMenuPreview
);
} }
>
{ hasIcon && (
<>
<OverlayMenuIcon icon={ icon } />
<Icon icon={ close } />
</>
) }
{ ! hasIcon && (
<>
<span>{ __( 'Menu' ) }</span>
<span>{ __( 'Close' ) }</span>
</>
) }
</Button>
{ overlayMenuPreview && (
<OverlayMenuPreview
setAttributes={ setAttributes }
hasIcon={ hasIcon }
icon={ icon }
/>
) }
</Button>
) }
{ overlayMenuPreview && (
<OverlayMenuPreview
setAttributes={ setAttributes }
hasIcon={ hasIcon }
icon={ icon }
/>
</>
) }
<h3>{ __( 'Overlay Menu' ) }</h3>
<ToggleGroupControl
Expand Down

0 comments on commit 0ac7078

Please sign in to comment.