Skip to content

Commit

Permalink
Improvements to "inherit default layout" toggle (#41893)
Browse files Browse the repository at this point in the history
* Improvements to "inherit default layout" toggle

* Update copy

* Update packages/block-editor/src/hooks/layout.js

Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>

Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
  • Loading branch information
tellthemachines and andrewserong committed Jun 27, 2022
1 parent 9a761d3 commit f6f0cea
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,26 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
<InspectorControls>
<PanelBody title={ __( 'Layout' ) }>
{ showInheritToggle && (
<ToggleControl
label={ __( 'Inherit default layout' ) }
checked={ !! inherit }
onChange={ () =>
setAttributes( {
layout: { inherit: ! inherit },
} )
}
/>
<>
<ToggleControl
label={ __( 'Inner blocks use full width' ) }
checked={ ! inherit }
onChange={ () =>
setAttributes( {
layout: { inherit: ! inherit },
} )
}
/>
<p className="block-editor-hooks__layout-controls-helptext">
{ !! inherit
? __(
'Nested blocks use theme content width with options for full and wide widths.'
)
: __(
'Nested blocks will fill the width of this container.'
) }
</p>
</>
) }

{ ! inherit && allowSwitching && (
Expand Down

0 comments on commit f6f0cea

Please sign in to comment.