[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 <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
39dc6183b5
Коммит
88f9f6972f
@@ -1,13 +1,11 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
defaultOverlayShown={false}
|
id="recentMentions"
|
||||||
delayShow={400}
|
placement="bottom"
|
||||||
overlay={
|
title={
|
||||||
<Tooltip
|
<React.Fragment>
|
||||||
id="recentMentions"
|
|
||||||
>
|
|
||||||
<Memo(MemoizedFormattedMessage)
|
<Memo(MemoizedFormattedMessage)
|
||||||
defaultMessage="Recent mentions"
|
defaultMessage="Recent mentions"
|
||||||
id="channel_header.recentMentions"
|
id="channel_header.recentMentions"
|
||||||
@@ -28,14 +26,7 @@ exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</React.Fragment>
|
||||||
}
|
|
||||||
placement="bottom"
|
|
||||||
trigger={
|
|
||||||
Array [
|
|
||||||
"hover",
|
|
||||||
"focus",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ForwardRef
|
<ForwardRef
|
||||||
@@ -49,5 +40,5 @@ exports[`components/global/AtMentionsButton should match snapshot 1`] = `
|
|||||||
size="sm"
|
size="sm"
|
||||||
toggled={false}
|
toggled={false}
|
||||||
/>
|
/>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ import {closeRightHandSide, showMentions} from 'actions/views/rhs';
|
|||||||
import {getRhsState} from 'selectors/rhs';
|
import {getRhsState} from 'selectors/rhs';
|
||||||
|
|
||||||
import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
||||||
import OverlayTrigger from 'components/overlay_trigger';
|
import WithTooltip from 'components/with_tooltip';
|
||||||
import Tooltip from 'components/tooltip';
|
|
||||||
|
|
||||||
import Constants, {RHSStates} from 'utils/constants';
|
import {RHSStates} from 'utils/constants';
|
||||||
|
|
||||||
import type {GlobalState} from 'types/store';
|
import type {GlobalState} from 'types/store';
|
||||||
|
|
||||||
@@ -32,26 +31,23 @@ const AtMentionsButton = (): JSX.Element => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const tooltip = (
|
|
||||||
<Tooltip id='recentMentions'>
|
|
||||||
<FormattedMessage
|
|
||||||
id='channel_header.recentMentions'
|
|
||||||
defaultMessage='Recent mentions'
|
|
||||||
/>
|
|
||||||
<KeyboardShortcutSequence
|
|
||||||
shortcut={KEYBOARD_SHORTCUTS.navMentions}
|
|
||||||
hideDescription={true}
|
|
||||||
isInsideTooltip={true}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
trigger={['hover', 'focus']}
|
id='recentMentions'
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
overlay={tooltip}
|
title={
|
||||||
|
<>
|
||||||
|
<FormattedMessage
|
||||||
|
id='channel_header.recentMentions'
|
||||||
|
defaultMessage='Recent mentions'
|
||||||
|
/>
|
||||||
|
<KeyboardShortcutSequence
|
||||||
|
shortcut={KEYBOARD_SHORTCUTS.navMentions}
|
||||||
|
hideDescription={true}
|
||||||
|
isInsideTooltip={true}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
size={'sm'}
|
size={'sm'}
|
||||||
@@ -64,7 +60,7 @@ const AtMentionsButton = (): JSX.Element => {
|
|||||||
aria-controls='searchContainer' // Must be changed if the ID of the container changes
|
aria-controls='searchContainer' // Must be changed if the ID of the container changes
|
||||||
aria-label={formatMessage({id: 'channel_header.recentMentions', defaultMessage: 'Recent mentions'})}
|
aria-label={formatMessage({id: 'channel_header.recentMentions', defaultMessage: 'Recent mentions'})}
|
||||||
/>
|
/>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user