[MM-60154] Migrate tooltips of components/advanced_text_editor/formatting_bar/formatting_icon.tsx' to WithTooltip (#27949)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8ccdca0954
Коммит
742d6d1e4a
@@ -24,10 +24,8 @@ import KeyboardShortcutSequence, {
|
|||||||
} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
||||||
import type {
|
import type {
|
||||||
KeyboardShortcutDescriptor} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
KeyboardShortcutDescriptor} 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 from 'utils/constants';
|
|
||||||
import type {MarkdownMode} from 'utils/markdown/apply_markdown';
|
import type {MarkdownMode} from 'utils/markdown/apply_markdown';
|
||||||
|
|
||||||
export const IconContainer = styled.button`
|
export const IconContainer = styled.button`
|
||||||
@@ -146,25 +144,21 @@ const FormattingIcon = (props: FormattingIconProps): JSX.Element => {
|
|||||||
|
|
||||||
/* get the correct tooltip from the ShortcutsMap */
|
/* get the correct tooltip from the ShortcutsMap */
|
||||||
const shortcut = MAP_MARKDOWN_MODE_TO_KEYBOARD_SHORTCUTS[mode];
|
const shortcut = MAP_MARKDOWN_MODE_TO_KEYBOARD_SHORTCUTS[mode];
|
||||||
const tooltip = (
|
|
||||||
<Tooltip id='upload-tooltip'>
|
|
||||||
<KeyboardShortcutSequence
|
|
||||||
shortcut={shortcut}
|
|
||||||
hoistDescription={true}
|
|
||||||
isInsideTooltip={true}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
id='formatting-icon-tooltip'
|
||||||
placement='top'
|
placement='top'
|
||||||
trigger={['hover', 'focus']}
|
title={
|
||||||
overlay={tooltip}
|
<KeyboardShortcutSequence
|
||||||
|
shortcut={shortcut}
|
||||||
|
hoistDescription={true}
|
||||||
|
isInsideTooltip={true}
|
||||||
|
/>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{bodyAction}
|
{bodyAction}
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user