mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-58443] Migrate tooltips of 'components/global_header/right_controls/saved_posts_button/saved_posts_button.tsx' to WithTooltip (#27185)
* add withtooltip handling * add withtooltip handling * placed icon inside tooltip * Update saved_posts_button.tsx * Update saved_posts_button.tsx * Update saved_posts_button.test.tsx.snap * Update saved_posts_button.tsx --------- Co-authored-by: surajanthwal <surajanthwal2010@gmail.com> Co-authored-by: M-ZubairAhmed <m-zubairahmed@protonmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
6d427cf005
commit
9f396c9294
@ -1,25 +1,14 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
||||
<OverlayTrigger
|
||||
defaultOverlayShown={false}
|
||||
delayShow={400}
|
||||
overlay={
|
||||
<Tooltip
|
||||
<WithTooltip
|
||||
id="recentMentions"
|
||||
>
|
||||
placement="bottom"
|
||||
title={
|
||||
<Memo(MemoizedFormattedMessage)
|
||||
defaultMessage="Saved messages"
|
||||
id="channel_header.flagged"
|
||||
/>
|
||||
</Tooltip>
|
||||
}
|
||||
placement="bottom"
|
||||
trigger={
|
||||
Array [
|
||||
"hover",
|
||||
"focus",
|
||||
]
|
||||
}
|
||||
>
|
||||
<ForwardRef
|
||||
@ -33,5 +22,5 @@ exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
||||
size="sm"
|
||||
toggled={false}
|
||||
/>
|
||||
</OverlayTrigger>
|
||||
</WithTooltip>
|
||||
`;
|
||||
|
@ -10,10 +10,9 @@ import IconButton from '@mattermost/compass-components/components/icon-button';
|
||||
import {closeRightHandSide, showFlaggedPosts} from 'actions/views/rhs';
|
||||
import {getRhsState} from 'selectors/rhs';
|
||||
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import WithTooltip from 'components/with_tooltip';
|
||||
|
||||
import Constants, {RHSStates} from 'utils/constants';
|
||||
import {RHSStates} from 'utils/constants';
|
||||
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
@ -31,21 +30,16 @@ const SavedPostsButton = (): JSX.Element | null => {
|
||||
}
|
||||
};
|
||||
|
||||
const tooltip = (
|
||||
<Tooltip id='recentMentions'>
|
||||
return (
|
||||
<WithTooltip
|
||||
id='recentMentions'
|
||||
title={
|
||||
<FormattedMessage
|
||||
id='channel_header.flagged'
|
||||
defaultMessage='Saved messages'
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
return (
|
||||
<OverlayTrigger
|
||||
trigger={['hover', 'focus']}
|
||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
||||
}
|
||||
placement='bottom'
|
||||
overlay={tooltip}
|
||||
>
|
||||
<IconButton
|
||||
size={'sm'}
|
||||
@ -58,7 +52,7 @@ const SavedPostsButton = (): JSX.Element | null => {
|
||||
aria-controls='searchContainer' // Must be changed if the ID of the container changes
|
||||
aria-label={formatMessage({id: 'channel_header.flagged', defaultMessage: 'Saved messages'})}
|
||||
/>
|
||||
</OverlayTrigger>
|
||||
</WithTooltip>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user