Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 21, 2020
1 parent 7d2d1d0 commit 6bd8b7d
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,6 @@ export const BlockComponent = forwardRef( ( { children, tagName, ...props }, ref
! isTypingWithinBlock;

const isDragging = isDraggingBlocks && ( isSelected || isPartOfMultiSelection );

// Determine whether the block has props to apply to the wrapper.
if ( blockType.getEditWrapperProps ) {
wrapperProps = {
...wrapperProps,
...blockType.getEditWrapperProps( attributes ),
};
}

const isAligned = wrapperProps && wrapperProps[ 'data-align' ];

// The wp-block className is important for editor styles.
Expand Down Expand Up @@ -345,17 +336,6 @@ function BlockListBlock( {
/>
);

// For aligned blocks, provide a wrapper element so the block can be
// positioned relative to the block column. This is enabled with the
// .is-block-content className.
if ( isAligned ) {
blockEdit = <div className="is-block-content">{ blockEdit }</div>;
}

if ( mode !== 'visual' ) {
blockEdit = <div style={ { display: 'none' } }>{ blockEdit }</div>;
}

const blockType = getBlockType( name );
const lightBlockWrapper = hasBlockSupport( blockType, 'lightBlockWrapper', false );
const value = {
Expand Down Expand Up @@ -395,6 +375,19 @@ function BlockListBlock( {
value.wrapperProps = wrapperProps;
}

const isAligned = wrapperProps && wrapperProps[ 'data-align' ];

// For aligned blocks, provide a wrapper element so the block can be
// positioned relative to the block column. This is enabled with the
// .is-block-content className.
if ( isAligned ) {
blockEdit = <div className="is-block-content">{ blockEdit }</div>;
}

if ( mode !== 'visual' ) {
blockEdit = <div style={ { display: 'none' } }>{ blockEdit }</div>;
}

const memoizedValue = useMemo( () => value, Object.values( value ) );

return (
Expand Down

0 comments on commit 6bd8b7d

Please sign in to comment.