Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mobile]Remove alignment options from Media & Text until they are fixed #18112

Merged
merged 2 commits into from
Oct 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/block-library/src/media-text/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { View } from 'react-native';
import { __, _x } from '@wordpress/i18n';
import {
BlockControls,
BlockVerticalAlignmentToolbar,
// BlockVerticalAlignmentToolbar,
InnerBlocks,
withColors,
} from '@wordpress/block-editor';
Expand Down Expand Up @@ -131,15 +131,16 @@ class MediaTextEdit extends Component {
attributes,
backgroundColor,
setAttributes,
isMobile,
// isMobile,
} = this.props;
const {
isStackedOnMobile,
// isStackedOnMobile,
mediaPosition,
mediaWidth,
verticalAlignment,
} = attributes;
const shouldStack = isStackedOnMobile && isMobile;
const shouldStack = false; // We are temporarily not stacking until we fix alignment buttons
// const shouldStack = isStackedOnMobile && isMobile; // <<< Original line
const temporaryMediaWidth = shouldStack ? 100 : ( this.state.mediaWidth || mediaWidth );
const widthString = `${ temporaryMediaWidth }%`;
const containerStyles = {
Expand All @@ -165,21 +166,22 @@ class MediaTextEdit extends Component {
onClick: () => setAttributes( { mediaPosition: 'right' } ),
} ];

const onVerticalAlignmentChange = ( alignment ) => {
/* const onVerticalAlignmentChange = ( alignment ) => {
setAttributes( { verticalAlignment: alignment } );
};
}; */

return (
<>
<BlockControls>
<Toolbar
controls={ toolbarControls }
/>
{ /* // Temporarily commenting out until alignment functionality is fixed
<BlockVerticalAlignmentToolbar
onChange={ onVerticalAlignmentChange }
value={ verticalAlignment }
isCollapsed={ false }
/>
/> */ }
Comment on lines +179 to +184
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking if we would benefit from using a dev flag instead of commenting out the code.
Alternatively we could actually remove the not-needed code and then revert this commit.

But since it's a hot-fix and this seems to be intended to be worked on right away after the release (I might be wrong :) I think it's OK to merge as it is. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we are going to revisit this.

DEV flag sounds good but it requires much complex testing effort like generating bundles and opening PRs on parent apps.

IMHO removing is better, but we'll try bringing this back in a few weeks so not sure it'll worth it, and in that case bringing this code back would generate much more diff. But according to what happens next we should definitely revisit this.

</BlockControls>
<View style={ containerStyles }>
<View style={ { width: widthString } }>
Expand Down