From 93a59e5cadf03e3be3a7318bb05f5b686dc4e77d Mon Sep 17 00:00:00 2001 From: Michael <74271024+KvngMikey@users.noreply.github.com> Date: Fri, 23 Aug 2024 04:04:06 +0100 Subject: [PATCH] [MM-60160] Migrate tooltips of "components/global_header/left_controls/history_buttons/history_buttons.tsx" to WithTooltip (#28013) --- .../history_buttons/history_buttons.tsx | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/webapp/channels/src/components/global_header/left_controls/history_buttons/history_buttons.tsx b/webapp/channels/src/components/global_header/left_controls/history_buttons/history_buttons.tsx index 4caaf600cf..4e459bdd78 100644 --- a/webapp/channels/src/components/global_header/left_controls/history_buttons/history_buttons.tsx +++ b/webapp/channels/src/components/global_header/left_controls/history_buttons/history_buttons.tsx @@ -14,10 +14,8 @@ import KeyboardShortcutSequence, { } from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; import type { KeyboardShortcutDescriptor} 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 from 'utils/constants'; import DesktopApp from 'utils/desktop_api'; import * as Utils from 'utils/utils'; @@ -37,16 +35,13 @@ const HistoryButtons = (): JSX.Element => { const [canGoForward, setCanGoForward] = useState(true); const getTooltip = (shortcut: KeyboardShortcutDescriptor) => ( - - - + ); + const goBack = () => { trackEvent('ui', 'ui_history_back'); history.goBack(); @@ -76,11 +71,10 @@ const HistoryButtons = (): JSX.Element => { return ( - { disabled={!canGoBack} aria-label={Utils.localizeMessage('sidebar_left.channel_navigator.goBackLabel', 'Back')} /> - - + { disabled={!canGoForward} aria-label={Utils.localizeMessage('sidebar_left.channel_navigator.goForwardLabel', 'Forward')} /> - + ); };