[MM-59331] Migrate tooltips of "components/post_view/post_attachment_opengraph/post_attachment_opengraph.tsx" to WithTooltip (#27617)

Этот коммит содержится в:
Arya Khochare
2024-07-29 00:27:30 +05:30
коммит произвёл GitHub
родитель 0c5497a770
Коммит 6e48961756

Просмотреть файл

@@ -16,10 +16,9 @@ import type {
import AutoHeightSwitcher from 'components/common/auto_height_switcher';
import ExternalImage from 'components/external_image';
import ExternalLink from 'components/external_link';
import OverlayTrigger from 'components/overlay_trigger';
import Tooltip from 'components/tooltip';
import WithTooltip from 'components/with_tooltip';
import Constants, {PostTypes} from 'utils/constants';
import {PostTypes} from 'utils/constants';
import {isSystemMessage} from 'utils/post_utils';
import {makeUrlSafe} from 'utils/url';
@@ -119,12 +118,6 @@ const PostAttachmentOpenGraph = ({openGraphData, post, actions, link, isInPermal
return actions.editPost(patchedPost);
};
const removeButtonTooltip = (
<Tooltip id={`removeLinkPreview-${post.id}`}>
{formatMessage({id: 'link_preview.remove_link_preview', defaultMessage: 'Remove link preview'})}
</Tooltip>
);
const safeLink = makeUrlSafe(openGraphData?.url || link);
return (
@@ -136,10 +129,10 @@ const PostAttachmentOpenGraph = ({openGraphData, post, actions, link, isInPermal
location='post_attachment_opengraph'
>
{rest.currentUserId === post.user_id && !isInPermalink && (
<OverlayTrigger
<WithTooltip
id={`removeLinkPreview-${post.id}`}
placement='top'
delayShow={Constants.OVERLAY_TIME_DELAY}
overlay={removeButtonTooltip}
title={formatMessage({id: 'link_preview.remove_link_preview', defaultMessage: 'Remove link preview'})}
>
<button
type='button'
@@ -153,7 +146,7 @@ const PostAttachmentOpenGraph = ({openGraphData, post, actions, link, isInPermal
color={'currentColor'}
/>
</button>
</OverlayTrigger>
</WithTooltip>
)}
<PostAttachmentOpenGraphBody
isInPermalink={isInPermalink}