From c77115155e6609ca48d020f557c3c082b260cb00 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 5 Feb 2024 14:43:06 +1100 Subject: [PATCH] Remove redundant props --- .../src/components/child-layout-control/index.js | 9 +++++++-- .../src/components/global-styles/dimensions-panel.js | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/child-layout-control/index.js b/packages/block-editor/src/components/child-layout-control/index.js index 72d3cd5e8f9ab..544279755b0ab 100644 --- a/packages/block-editor/src/components/child-layout-control/index.js +++ b/packages/block-editor/src/components/child-layout-control/index.js @@ -25,7 +25,6 @@ import { store as blockEditorStore } from '../../store'; * @param {Function} props.onChange Function to update the child layout value. * @param {Object} props.parentLayout The parent layout value. * - * @param {string} props.align * @param {string} props.clientId * @return {Element} child layout edit element. */ @@ -34,7 +33,6 @@ export default function ChildLayoutControl( { value = {}, onChange, parentLayout, - align, clientId, } ) { const { @@ -52,6 +50,13 @@ export default function ChildLayoutControl( { ); const blockSupportsAlign = getBlockSupport( blockName, 'align' ); + const blockAttributes = useSelect( + ( select ) => select( blockEditorStore ).getBlockAttributes( clientId ), + [ clientId ] + ); + + const { align = null } = blockAttributes ?? {}; + const supportsWideAlign = blockSupportsAlign === true || ( Array.isArray( blockSupportsAlign ) && diff --git a/packages/block-editor/src/components/global-styles/dimensions-panel.js b/packages/block-editor/src/components/global-styles/dimensions-panel.js index 4486f4c0b6698..e93dc6b9e1d1a 100644 --- a/packages/block-editor/src/components/global-styles/dimensions-panel.js +++ b/packages/block-editor/src/components/global-styles/dimensions-panel.js @@ -541,7 +541,6 @@ export default function DimensionsPanel( { value={ inheritedValue } onChange={ setChildLayout } parentLayout={ settings?.parentLayout } - align={ settings?.align } clientId={ clientId } />