From 88f9f6972fa5ed1858a22d29930676cef75bca65 Mon Sep 17 00:00:00 2001 From: Zubair Imtiaz <106450046+ZubairImtiaz3@users.noreply.github.com> Date: Tue, 13 Aug 2024 19:57:04 +0500 Subject: [PATCH] [MM-60161] Migrate tooltips of 'components/global_header/right_controls/at_mentions_button/at_mentions_button.tsx' to WithTooltip (#27951) Co-authored-by: Mattermost Build --- .../at_mentions_button.test.tsx.snap | 23 ++++------- .../at_mentions_button/at_mentions_button.tsx | 40 +++++++++---------- 2 files changed, 25 insertions(+), 38 deletions(-) diff --git a/webapp/channels/src/components/global_header/right_controls/at_mentions_button/__snapshots__/at_mentions_button.test.tsx.snap b/webapp/channels/src/components/global_header/right_controls/at_mentions_button/__snapshots__/at_mentions_button.test.tsx.snap index a645e986cd..5a0d2082ac 100644 --- a/webapp/channels/src/components/global_header/right_controls/at_mentions_button/__snapshots__/at_mentions_button.test.tsx.snap +++ b/webapp/channels/src/components/global_header/right_controls/at_mentions_button/__snapshots__/at_mentions_button.test.tsx.snap @@ -1,13 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`components/global/AtMentionsButton should match snapshot 1`] = ` - + - - } - placement="bottom" - trigger={ - Array [ - "hover", - "focus", - ] + } > - + `; diff --git a/webapp/channels/src/components/global_header/right_controls/at_mentions_button/at_mentions_button.tsx b/webapp/channels/src/components/global_header/right_controls/at_mentions_button/at_mentions_button.tsx index 87f2a6b016..361658b0e3 100644 --- a/webapp/channels/src/components/global_header/right_controls/at_mentions_button/at_mentions_button.tsx +++ b/webapp/channels/src/components/global_header/right_controls/at_mentions_button/at_mentions_button.tsx @@ -11,10 +11,9 @@ import {closeRightHandSide, showMentions} from 'actions/views/rhs'; import {getRhsState} from 'selectors/rhs'; import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; -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'; @@ -32,26 +31,23 @@ const AtMentionsButton = (): JSX.Element => { } }; - const tooltip = ( - - - - - ); - return ( - + + + + } > { aria-controls='searchContainer' // Must be changed if the ID of the container changes aria-label={formatMessage({id: 'channel_header.recentMentions', defaultMessage: 'Recent mentions'})} /> - + ); };