Skip to content

Commit

Permalink
Mobile: Remove size settings (#13750)
Browse files Browse the repository at this point in the history
* Mobile: Remove Size Setting from Image Block.

* Organizing imports on mobile ImageEdit

* Fix lint issues
  • Loading branch information
etoledom authored Feb 11, 2019
1 parent 52e8384 commit 1c583b2
Showing 1 changed file with 14 additions and 39 deletions.
53 changes: 14 additions & 39 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@ import {
requestImageFailedRetryDialog,
requestImageUploadCancelDialog,
} from 'react-native-gutenberg-bridge';
import {
map,
compact,
} from 'lodash';

/**
* WordPress dependencies
*/
import { MediaPlaceholder, RichText, BlockControls, InspectorControls, BottomSheet } from '@wordpress/editor';
import { Toolbar, ToolbarButton, Spinner, Dashicon } from '@wordpress/components';
import {
Toolbar,
ToolbarButton,
Spinner,
Dashicon,
} from '@wordpress/components';
import {
MediaPlaceholder,
RichText,
BlockControls,
InspectorControls,
BottomSheet,
} from '@wordpress/editor';
import { __ } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { compose } from '@wordpress/compose';
import { withSelect } from '@wordpress/data';

/**
* Internal dependencies
Expand Down Expand Up @@ -158,16 +163,6 @@ class ImageEdit extends React.Component {
} );
}

getImageSizeOptions() {
const { imageSizes } = this.props;
return compact( map( imageSizes, ( { label, slug } ) => {
return {
value: this.props.attributes.url + slug, //temporary url
label,
};
} ) );
}

render() {
const { attributes, isSelected, setAttributes } = this.props;
const { url, caption, height, width, alt, href } = attributes;
Expand Down Expand Up @@ -226,8 +221,6 @@ class ImageEdit extends React.Component {
</Toolbar>
);

const sizeOptions = this.getImageSizeOptions();

const getInspectorControls = () => (
<BottomSheet
isVisible={ this.state.showSettings }
Expand All @@ -243,13 +236,6 @@ class ImageEdit extends React.Component {
autoCapitalize="none"
autoCorrect={ false }
/>
<BottomSheet.PickerCell
icon="editor-expand"
label={ __( 'Image Size' ) }
value={ 'Large' } // Temporary for UI implementation.
options={ sizeOptions }
onChangeValue={ () => {} } // Temporary for UI implementation.
/>
<BottomSheet.Cell
icon={ 'editor-textcolor' }
label={ __( 'Alt Text' ) }
Expand Down Expand Up @@ -339,15 +325,4 @@ class ImageEdit extends React.Component {
}
}

export default compose( [
withSelect( ( select ) => {
const { getEditorSettings } = select( 'core/editor' );
const { maxWidth, isRTL, imageSizes } = getEditorSettings();

return {
maxWidth,
isRTL,
imageSizes,
};
} ),
] )( ImageEdit );
export default ImageEdit;

0 comments on commit 1c583b2

Please sign in to comment.