diff --git a/packages/block-library/src/group/variations.js b/packages/block-library/src/group/variations.js index 8589b7f73fed4..5251db2023734 100644 --- a/packages/block-library/src/group/variations.js +++ b/packages/block-library/src/group/variations.js @@ -12,11 +12,6 @@ const variations = [ attributes: { layout: { type: 'constrained' } }, isDefault: true, scope: [ 'block', 'inserter', 'transform' ], - isActive: ( blockAttributes ) => - ! blockAttributes.layout || - ! blockAttributes.layout?.type || - blockAttributes.layout?.type === 'default' || - blockAttributes.layout?.type === 'constrained', icon: group, }, { @@ -25,10 +20,7 @@ const variations = [ description: __( 'Arrange blocks horizontally.' ), attributes: { layout: { type: 'flex', flexWrap: 'nowrap' } }, scope: [ 'block', 'inserter', 'transform' ], - isActive: ( blockAttributes ) => - blockAttributes.layout?.type === 'flex' && - ( ! blockAttributes.layout?.orientation || - blockAttributes.layout?.orientation === 'horizontal' ), + isActive: [ 'layout.type' ], icon: row, }, { @@ -37,9 +29,7 @@ const variations = [ description: __( 'Arrange blocks vertically.' ), attributes: { layout: { type: 'flex', orientation: 'vertical' } }, scope: [ 'block', 'inserter', 'transform' ], - isActive: ( blockAttributes ) => - blockAttributes.layout?.type === 'flex' && - blockAttributes.layout?.orientation === 'vertical', + isActive: [ 'layout.type', 'layout.orientation' ], icon: stack, }, { @@ -48,8 +38,7 @@ const variations = [ description: __( 'Arrange blocks in a grid.' ), attributes: { layout: { type: 'grid' } }, scope: [ 'block', 'inserter', 'transform' ], - isActive: ( blockAttributes ) => - blockAttributes.layout?.type === 'grid', + isActive: [ 'layout.type' ], icon: grid, }, ];