[MM-60163] Migrate tooltips of 'components/post_view/post_flag_icon' to WithTooltip (#27952)
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
88f9f6972f
Коммит
8465f6da2b
@@ -9,8 +9,7 @@ import {PencilOutlineIcon} from '@mattermost/compass-icons/components';
|
|||||||
|
|
||||||
import {getDateForTimezone} from 'mattermost-redux/utils/timezone_utils';
|
import {getDateForTimezone} from 'mattermost-redux/utils/timezone_utils';
|
||||||
|
|
||||||
import OverlayTrigger from 'components/overlay_trigger';
|
import WithTooltip from 'components/with_tooltip';
|
||||||
import Tooltip from 'components/tooltip';
|
|
||||||
|
|
||||||
import {isSameDay, isWithinLastWeek, isYesterday} from 'utils/datetime';
|
import {isSameDay, isWithinLastWeek, isYesterday} from 'utils/datetime';
|
||||||
|
|
||||||
@@ -65,16 +64,6 @@ const PostEditedIndicator = ({postId, isMilitaryTime, timeZone, editedAt = 0, po
|
|||||||
<span className='view-history__text'>{viewHistoryText}</span>
|
<span className='view-history__text'>{viewHistoryText}</span>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
const tooltip = (
|
|
||||||
<Tooltip
|
|
||||||
id={`edited-post-tooltip_${postId}`}
|
|
||||||
className='hidden-xs'
|
|
||||||
>
|
|
||||||
{`${editedText} ${formattedTime}`}
|
|
||||||
{postOwnerTooltipInfo}
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
|
|
||||||
const showPostEditHistory = (e: MouseEvent<HTMLButtonElement>) => {
|
const showPostEditHistory = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (post?.id) {
|
if (post?.id) {
|
||||||
@@ -105,13 +94,18 @@ const PostEditedIndicator = ({postId, isMilitaryTime, timeZone, editedAt = 0, po
|
|||||||
) : editedIndicatorContent;
|
) : editedIndicatorContent;
|
||||||
|
|
||||||
return !postId || editedAt === 0 ? null : (
|
return !postId || editedAt === 0 ? null : (
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
delayShow={250}
|
|
||||||
placement='top'
|
placement='top'
|
||||||
overlay={tooltip}
|
id={`edited-post-tooltip_${postId}`}
|
||||||
|
title={
|
||||||
|
<>
|
||||||
|
{`${editedText} ${formattedTime}`}
|
||||||
|
{postOwnerTooltipInfo}
|
||||||
|
</>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{editedIndicator}
|
{editedIndicator}
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user