diff --git a/packages/block-library/src/rich-image/rich-image/icon.js b/packages/block-library/src/rich-image/rich-image/icon.js deleted file mode 100644 index ef8691ddb78028..00000000000000 --- a/packages/block-library/src/rich-image/rich-image/icon.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * WordPress dependencies - */ -import { Path, SVG } from '@wordpress/components'; - -export const RotateLeftIcon = () => { - return ( - - - - ); -}; - -export const RotateRightIcon = () => { - return ( - - - - ); -}; - -export const FlipHorizontalIcon = () => { - return ( - - - - ); -}; - -export const FlipVerticalIcon = () => { - return ( - - - - ); -}; - -export const CropIcon = () => { - return ( - - - - ); -}; - -export const AspectIcon = () => { - return ( - - - - ); -}; diff --git a/packages/block-library/src/rich-image/rich-image/index.js b/packages/block-library/src/rich-image/rich-image/index.js index ba524f5a584d4b..2f5552eb79a123 100644 --- a/packages/block-library/src/rich-image/rich-image/index.js +++ b/packages/block-library/src/rich-image/rich-image/index.js @@ -14,6 +14,14 @@ import { __experimentalBlock as Block, } from '@wordpress/block-editor'; import { Fragment, Component } from '@wordpress/element'; +import { + rotateLeft, + rotateRight, + flipHorizontal, + flipVertical, + crop, + aspectRatio, +} from '@wordpress/icons'; import { ToolbarGroup, ToolbarButton, @@ -31,14 +39,6 @@ import { compose } from '@wordpress/compose'; * Internal dependencies */ import richImageRequest from './api'; -import { - RotateLeftIcon, - RotateRightIcon, - FlipHorizontalIcon, - FlipVerticalIcon, - CropIcon, - AspectIcon, -} from './icon'; const ROTATE_STEP = 90; const DEFAULT_CROP = { @@ -102,13 +102,11 @@ class RichImage extends Component { } cropImage() { - const { crop } = this.state; - this.adjustImage( 'crop', { - cropX: crop.x, - cropY: crop.y, - cropWidth: crop.width, - cropHeight: crop.height, + cropX: this.state.crop.x, + cropY: this.state.crop.y, + cropWidth: this.state.crop.width, + cropHeight: this.state.crop.height, } ); } @@ -214,13 +212,13 @@ class RichImage extends Component { { ( toggleProps ) => ( } + icon={ rotateLeft } label={ __( 'Rotate' ) } popoverProps={ POPOVER_PROPS } toggleProps={ toggleProps } controls={ [ { - icon: , + icon: rotateLeft, title: __( 'Rotate left' ), isDisabled: inProgress, onClick: () => @@ -232,7 +230,7 @@ class RichImage extends Component { ), }, { - icon: , + icon: rotateRight, title: __( 'Rotate right' ), isDisabled: inProgress, onClick: () => @@ -250,13 +248,13 @@ class RichImage extends Component { { ( toggleProps ) => ( } + icon={ flipVertical } label={ __( 'Flip' ) } popoverProps={ POPOVER_PROPS } toggleProps={ toggleProps } controls={ [ { - icon: , + icon: flipVertical, title: __( 'Flip vertical' ), isDisabled: inProgress, onClick: () => @@ -265,7 +263,7 @@ class RichImage extends Component { } ), }, { - icon: , + icon: flipHorizontal, title: __( 'Flip horizontal' ), isDisabled: inProgress, onClick: () => @@ -279,7 +277,7 @@ class RichImage extends Component { } + icon={ crop } label={ __( 'Crop' ) } onClick={ () => this.setState( { @@ -296,14 +294,14 @@ class RichImage extends Component {
- +
{ ( toggleProps ) => ( } + icon={ aspectRatio } label={ __( 'Aspect Ratio' ) } popoverProps={ POPOVER_PROPS } toggleProps={ toggleProps }