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