Skip to content

Commit

Permalink
Migrate customPadding to padding in the client
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 3, 2021
1 parent 065ff33 commit 01ccf2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/use-setting/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const deprecatedFlags = {

return settings.enableCustomUnits;
},
'spacing.customPadding': ( settings ) => settings.enableCustomSpacing,
'spacing.padding': ( settings ) => settings.enableCustomSpacing,
};

const prefixedFlags = {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/padding.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function resetPadding( { attributes = {}, setAttributes } ) {
* @return {boolean} Whether padding setting is disabled.
*/
export function useIsPaddingDisabled( { name: blockName } = {} ) {
const isDisabled = ! useSetting( 'spacing.customPadding' );
const isDisabled = ! useSetting( 'spacing.padding' );
const isInvalid = ! useIsDimensionsSupportValid( blockName, 'padding' );

return ! hasPaddingSupport( blockName ) || isDisabled || isInvalid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useHasDimensionsPanel( name ) {

function useHasPadding( name ) {
const supports = getSupportedGlobalStylesPanels( name );
const [ settings ] = useSetting( 'spacing.customPadding', name );
const [ settings ] = useSetting( 'spacing.padding', name );

return settings && supports.includes( 'padding' );
}
Expand Down

0 comments on commit 01ccf2b

Please sign in to comment.