mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-59902] Migrate tooltips of 'components/global_header/right_controls/settings_button/settings_button.tsx' to WithTooltip (#27823)
This commit is contained in:
parent
64cbdba3d7
commit
ed2d838ac7
@ -6,11 +6,10 @@ import {FormattedMessage, useIntl} from 'react-intl';
|
||||
|
||||
import IconButton from '@mattermost/compass-components/components/icon-button'; // eslint-disable-line no-restricted-imports
|
||||
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import UserSettingsModal from 'components/user_settings/modal';
|
||||
import WithTooltip from 'components/with_tooltip';
|
||||
|
||||
import Constants, {ModalIdentifiers} from 'utils/constants';
|
||||
import {ModalIdentifiers} from 'utils/constants';
|
||||
|
||||
import type {ModalData} from 'types/actions';
|
||||
|
||||
@ -23,21 +22,16 @@ type Props = {
|
||||
const SettingsButton = (props: Props): JSX.Element | null => {
|
||||
const {formatMessage} = useIntl();
|
||||
|
||||
const tooltip = (
|
||||
<Tooltip id='productSettings'>
|
||||
<FormattedMessage
|
||||
id='global_header.productSettings'
|
||||
defaultMessage='Settings'
|
||||
/>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
return (
|
||||
<OverlayTrigger
|
||||
trigger={['hover', 'focus']}
|
||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
||||
<WithTooltip
|
||||
id='productSettings'
|
||||
title={
|
||||
<FormattedMessage
|
||||
id='global_header.productSettings'
|
||||
defaultMessage='Settings'
|
||||
/>
|
||||
}
|
||||
placement='bottom'
|
||||
overlay={tooltip}
|
||||
>
|
||||
<IconButton
|
||||
size={'sm'}
|
||||
@ -50,7 +44,7 @@ const SettingsButton = (props: Props): JSX.Element | null => {
|
||||
aria-haspopup='dialog'
|
||||
aria-label={formatMessage({id: 'global_header.productSettings', defaultMessage: 'Settings'})}
|
||||
/>
|
||||
</OverlayTrigger>
|
||||
</WithTooltip>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user