Skip to content

Commit

Permalink
Update dimensions global style sidebar panel
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jul 8, 2021
1 parent 39473a5 commit 2cf8fc6
Showing 1 changed file with 30 additions and 21 deletions.
51 changes: 30 additions & 21 deletions packages/edit-site/src/components/sidebar/dimensions-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*/
import { __ } from '@wordpress/i18n';
import {
__experimentalBlockSupportPanel as BlockSupportPanel,
__experimentalProgressiveDisclosurePanel as ProgressiveDisclosurePanel,
__experimentalProgressiveDisclosurePanelItem as ProgressiveDisclosurePanelItem,
__experimentalBoxControl as BoxControl,
__experimentalUseCustomUnits as useCustomUnits,
} from '@wordpress/components';
Expand Down Expand Up @@ -103,37 +104,45 @@ export default function DimensionsPanel( { context, getStyle, setStyle } ) {
};

return (
<BlockSupportPanel
<ProgressiveDisclosurePanel
label={ __( 'Dimensions options' ) }
title={ __( 'Dimensions' ) }
resetAll={ resetAll }
>
{ showPaddingControl && (
<BoxControl
values={ paddingValues }
onChange={ setPaddingValues }
label={ __( 'Padding' ) }
sides={ paddingSides }
units={ units }
<ProgressiveDisclosurePanelItem
hasValue={ hasPaddingValue }
reset={ resetPaddingValue }
allowReset={ false }
label={ __( 'Padding' ) }
onDeselect={ resetPaddingValue }
isShownByDefault={ true }
/>
>
<BoxControl
values={ paddingValues }
onChange={ setPaddingValues }
label={ __( 'Padding' ) }
sides={ paddingSides }
units={ units }
allowReset={ false }
/>
</ProgressiveDisclosurePanelItem>
) }
{ showMarginControl && (
<BoxControl
values={ marginValues }
onChange={ setMarginValues }
label={ __( 'Margin' ) }
sides={ marginSides }
units={ units }
<ProgressiveDisclosurePanelItem
hasValue={ hasMarginValue }
reset={ resetMarginValue }
allowReset={ false }
label={ __( 'Margin' ) }
onDeselect={ resetMarginValue }
isShownByDefault={ true }
/>
>
<BoxControl
values={ marginValues }
onChange={ setMarginValues }
label={ __( 'Margin' ) }
sides={ marginSides }
units={ units }
allowReset={ false }
/>
</ProgressiveDisclosurePanelItem>
) }
</BlockSupportPanel>
</ProgressiveDisclosurePanel>
);
}

0 comments on commit 2cf8fc6

Please sign in to comment.