Skip to content

Commit

Permalink
[Mobile] - Remove old Layout Picker (#27640)
Browse files Browse the repository at this point in the history
* Mobile - Removing the old Layout picker except the Preview which was moved to the mobile components directory.

* Mobile - Remove isModalLayoutPicker flag

* Mobile - alignmentHelpers - fix tests

* Mobile - Remove unused modalLayoutPicker
  • Loading branch information
Gerardo Pacheco authored Jan 8, 2021
1 parent efbee9f commit 906407b
Show file tree
Hide file tree
Showing 45 changed files with 91 additions and 2,025 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ const stretchStyle = {
flex: 1,
};

const {
isFullWidth,
isWideWidth,
isWider,
isContainerRelated,
} = alignmentHelpers;

export class BlockListItem extends Component {
constructor() {
super( ...arguments );
Expand Down Expand Up @@ -60,6 +53,12 @@ export class BlockListItem extends Component {
parentWidth,
} = this.props;
const { blockWidth } = this.state;
const {
isFullWidth,
isWideWidth,
isWider,
isContainerRelated,
} = alignmentHelpers;

if ( isFullWidth( blockAlignment ) ) {
if ( ! hasParents ) {
Expand Down Expand Up @@ -106,6 +105,7 @@ export class BlockListItem extends Component {
hasParents,
parentBlockName,
} = this.props;
const { isFullWidth, isContainerRelated } = alignmentHelpers;

return [
readableContentViewStyle,
Expand Down Expand Up @@ -138,6 +138,8 @@ export class BlockListItem extends Component {
} = this.props;
const readableContentViewStyle =
contentResizeMode === 'stretch' && stretchStyle;
const { isContainerRelated } = alignmentHelpers;

return (
<ReadableContentView
align={ blockAlignment }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import BlockEdit from '../block-edit';
import BlockInvalidWarning from './block-invalid-warning';
import BlockMobileToolbar from '../block-mobile-toolbar';

const { isFullWidth, isWider, isContainerRelated } = alignmentHelpers;

function BlockForType( {
attributes,
clientId,
Expand Down Expand Up @@ -182,7 +180,7 @@ class BlockListBlock extends Component {
attributes,
order + 1
);

const { isFullWidth, isWider, isContainerRelated } = alignmentHelpers;
const accessible = ! ( isSelected || isInnerBlockSelected );
const screenWidth = Math.floor( Dimensions.get( 'window' ).width );
const isScreenWidthEqual = blockWidth === screenWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const getStyles = (
stylesMemo[ styleName ] = computedStyles;
return computedStyles;
};
const { isWider } = alignmentHelpers;

export class BlockList extends Component {
constructor() {
Expand Down Expand Up @@ -192,6 +191,7 @@ export class BlockList extends Component {

const isContentStretch = contentResizeMode === 'stretch';
const isMultiBlocks = blockClientIds.length > 1;
const { isWider } = alignmentHelpers;

return (
<View
Expand Down
5 changes: 0 additions & 5 deletions packages/block-editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ export {
export { default as VideoPlayer, VIDEO_ASPECT_RATIO } from './video-player';

// Content Related Components
export {
__experimentalPageTemplatePicker,
__experimentalWithPageTemplatePicker,
Preview,
} from './page-template-picker';
export { default as BlockList } from './block-list';
export { default as BlockMover } from './block-mover';
export { default as BlockToolbar } from './block-toolbar';
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 906407b

Please sign in to comment.