Skip to content

Commit

Permalink
Image settings button (#13597)
Browse files Browse the repository at this point in the history
* rnmobile: Implement image settings button using InspectorControls.Slot pattern.

* rnmobile: Add missing semicolon
  • Loading branch information
etoledom authored and youknowriad committed Mar 6, 2019
1 parent ec3c9c8 commit 4bd4845
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
/**
* Internal dependencies
*/
import { MediaPlaceholder, RichText, BlockControls } from '@wordpress/editor';
import { MediaPlaceholder, RichText, BlockControls, InspectorControls } from '@wordpress/editor';
import { Toolbar, ToolbarButton, Spinner } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import ImageSize from './image-size';
Expand Down Expand Up @@ -143,6 +143,10 @@ export default class ImageEdit extends React.Component {
);
}

const onImageSettingsButtonPressed = () => {

};

const toolbarEditButton = (
<Toolbar>
<ToolbarButton
Expand All @@ -153,6 +157,14 @@ export default class ImageEdit extends React.Component {
</Toolbar>
);

const inlineToolbarButtons = (
<ToolbarButton
label={ __( 'Image Settings' ) }
icon="admin-generic"
onClick={ onImageSettingsButtonPressed }
/>
);

const showSpinner = this.state.isUploadInProgress;
const opacity = this.state.isUploadInProgress ? 0.3 : 1;
const progress = this.state.progress * 100;
Expand All @@ -163,6 +175,9 @@ export default class ImageEdit extends React.Component {
<BlockControls>
{ toolbarEditButton }
</BlockControls>
<InspectorControls>
{ inlineToolbarButtons }
</InspectorControls>
<ImageSize src={ url } >
{ ( sizes ) => {
const {
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export { default as DefaultBlockAppender } from './default-block-appender';
export { default as PostTitle } from './post-title';
export { default as EditorHistoryRedo } from './editor-history/redo';
export { default as EditorHistoryUndo } from './editor-history/undo';
export { default as InspectorControls } from './inspector-controls';

0 comments on commit 4bd4845

Please sign in to comment.