diff --git a/packages/block-editor/src/components/link-control/index.js b/packages/block-editor/src/components/link-control/index.js index 5d6ab1fd512348..86bc0f8e004512 100644 --- a/packages/block-editor/src/components/link-control/index.js +++ b/packages/block-editor/src/components/link-control/index.js @@ -270,26 +270,18 @@ function LinkControl( { value={ value } onEditClick={ () => setIsEditingLink( true ) } hasRichPreviews={ hasRichPreviews } + hasUnlinkControl={ shownUnlinkControl } + onRemove={ onRemove } /> ) } - { ( showSettingsDrawer || shownUnlinkControl ) && ( + { showSettingsDrawer && (
- { shownUnlinkControl && ( - - ) }
) } diff --git a/packages/block-editor/src/components/link-control/link-preview.js b/packages/block-editor/src/components/link-control/link-preview.js index 225836d61be415..a1c85f51d9894c 100644 --- a/packages/block-editor/src/components/link-control/link-preview.js +++ b/packages/block-editor/src/components/link-control/link-preview.js @@ -13,7 +13,7 @@ import { __experimentalText as Text, } from '@wordpress/components'; import { filterURLForDisplay, safeDecodeURI } from '@wordpress/url'; -import { Icon, globe, info } from '@wordpress/icons'; +import { Icon, globe, info, linkOff, edit } from '@wordpress/icons'; /** * Internal dependencies @@ -26,6 +26,8 @@ export default function LinkPreview( { value, onEditClick, hasRichPreviews = false, + hasUnlinkControl = false, + onRemove, } ) { // Avoid fetching if rich previews are not desired. const showRichPreviews = hasRichPreviews ? value?.url : null; @@ -102,12 +104,21 @@ export default function LinkPreview( { + onClick={ onEditClick } + iconSize={ 24 } + /> + { hasUnlinkControl && ( +