Skip to content

Commit

Permalink
Revert "updates LayoutTypeSwitcher to use ToggleGroupControl (WordPre…
Browse files Browse the repository at this point in the history
…ss#65498)"

This reverts commit 1c34398.
  • Loading branch information
huubl authored Oct 2, 2024
1 parent 50d4c12 commit 18b7d74
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { addFilter } from '@wordpress/hooks';
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
import { useSelect } from '@wordpress/data';
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
Button,
ButtonGroup,
ToggleControl,
PanelBody,
privateApis as componentsPrivateApis,
Expand Down Expand Up @@ -315,26 +315,21 @@ export default {

function LayoutTypeSwitcher( { type, onChange } ) {
return (
<ToggleGroupControl
__next40pxDefaultSize
isBlock
label={ __( 'Layout type' ) }
__nextHasNoMarginBottom
hideLabelFromVision
isAdaptiveWidth
value={ type }
onChange={ onChange }
>
<ButtonGroup>
{ getLayoutTypes().map( ( { name, label } ) => {
return (
<ToggleGroupControlOption
<Button
// TODO: Switch to `true` (40px size) if possible
__next40pxDefaultSize={ false }
key={ name }
value={ name }
label={ label }
/>
isPressed={ type === name }
onClick={ () => onChange( name ) }
>
{ label }
</Button>
);
} ) }
</ToggleGroupControl>
</ButtonGroup>
);
}

Expand Down

0 comments on commit 18b7d74

Please sign in to comment.