Skip to content

Commit

Permalink
alignment options layout
Browse files Browse the repository at this point in the history
  • Loading branch information
SaxonF authored and tellthemachines committed Sep 1, 2023
1 parent eae5470 commit c84fe66
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { store as blockEditorStore } from '../../store';
* @param {string} props.clientId
* @return {WPElement} child layout edit element.
*/

export default function ChildLayoutControl( {
value = {},
onChange,
Expand Down Expand Up @@ -63,7 +64,8 @@ export default function ChildLayoutControl( {

const isConstrained =
parentLayoutTypeToUse === 'constrained' ||
parentLayoutTypeToUse === 'default';
parentLayoutTypeToUse === 'default' ||
parentLayoutTypeToUse === undefined;

const widthProp =
isConstrained || orientation === 'vertical'
Expand Down Expand Up @@ -313,7 +315,6 @@ export default function ChildLayoutControl( {
};

const onChangeHeight = ( newHeight ) => {
console.log( 'height:', orientation, heightProp, newHeight );
onChange( {
style: {
...value,
Expand Down Expand Up @@ -343,7 +344,7 @@ export default function ChildLayoutControl( {
childLayout[ widthProp ] === 'fixedNoShrink' ) && (
<FlexBlock>
<UnitControl
size={ '__unstable-large' }
__next36pxDefaultSize
onChange={ ( _value ) => {
onChange( {
style: {
Expand Down Expand Up @@ -376,7 +377,7 @@ export default function ChildLayoutControl( {
childLayout[ heightProp ] === 'fixedNoShrink' ) && (
<FlexBlock>
<UnitControl
size={ '__unstable-large' }
__next36pxDefaultSize
onChange={ ( _value ) => {
onChange( {
style: {
Expand Down
Loading

0 comments on commit c84fe66

Please sign in to comment.