diff --git a/packages/block-library/src/avatar/edit.js b/packages/block-library/src/avatar/edit.js index 8309bc5e878a0e..8ccaeb82fcf50b 100644 --- a/packages/block-library/src/avatar/edit.js +++ b/packages/block-library/src/avatar/edit.js @@ -82,6 +82,19 @@ const AvatarInspectorControls = ( { ); +const AvatarLinkWrapper = ( { children, isLink } ) => + isLink ? ( + event.preventDefault() } + > + { children } + + ) : ( + children + ); + const ResizableAvatar = ( { setAttributes, attributes, @@ -98,43 +111,46 @@ const ResizableAvatar = ( { ); return (
- { - setAttributes( { - size: parseInt( - attributes.size + ( delta.height || delta.width ), - 10 - ), - } ); - } } - lockAspectRatio - enable={ { - top: false, - right: ! isRTL(), - bottom: true, - left: isRTL(), - } } - minWidth={ avatar.minSize } - maxWidth={ avatar.maxSize } - > - { - + + { + setAttributes( { + size: parseInt( + attributes.size + + ( delta.height || delta.width ), + 10 + ), + } ); + } } + lockAspectRatio + enable={ { + top: false, + right: ! isRTL(), + bottom: true, + left: isRTL(), + } } + minWidth={ avatar.minSize } + maxWidth={ avatar.maxSize } + > + { + +
); }; @@ -150,29 +166,13 @@ const CommentEdit = ( { attributes, context, setAttributes, isSelected } ) => { attributes={ attributes } selectUser={ false } /> - { attributes.isLink ? ( - event.preventDefault() } - > - - - ) : ( - - ) } + ); }; @@ -193,29 +193,14 @@ const UserEdit = ( { attributes, context, setAttributes, isSelected } ) => { avatar={ avatar } setAttributes={ setAttributes } /> - { attributes.isLink ? ( - event.preventDefault() } - > - - - ) : ( - - ) } + + ); };