Skip to content

Commit

Permalink
Remove redundant props
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Feb 5, 2024
1 parent 62caeda commit c771151
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -34,7 +33,6 @@ export default function ChildLayoutControl( {
value = {},
onChange,
parentLayout,
align,
clientId,
} ) {
const {
Expand All @@ -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 ) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ export default function DimensionsPanel( {
value={ inheritedValue }
onChange={ setChildLayout }
parentLayout={ settings?.parentLayout }
align={ settings?.align }
clientId={ clientId }
/>
</VStack>
Expand Down

0 comments on commit c771151

Please sign in to comment.