[MM-59892] Migrate tooltips of 'components/app_bar/app_bar_binding.tsx' to WithTooltip (#27835)
Этот коммит содержится в:
@@ -2,7 +2,6 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Tooltip} from 'react-bootstrap';
|
|
||||||
import {useIntl} from 'react-intl';
|
import {useIntl} from 'react-intl';
|
||||||
import {useDispatch, useSelector} from 'react-redux';
|
import {useDispatch, useSelector} from 'react-redux';
|
||||||
|
|
||||||
@@ -14,10 +13,9 @@ import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
|
|||||||
|
|
||||||
import {handleBindingClick, openAppsModal, postEphemeralCallResponseForContext} from 'actions/apps';
|
import {handleBindingClick, openAppsModal, postEphemeralCallResponseForContext} from 'actions/apps';
|
||||||
|
|
||||||
import OverlayTrigger from 'components/overlay_trigger';
|
import WithTooltip from 'components/with_tooltip';
|
||||||
|
|
||||||
import {createCallContext} from 'utils/apps';
|
import {createCallContext} from 'utils/apps';
|
||||||
import Constants from 'utils/constants';
|
|
||||||
|
|
||||||
import type {DoAppCallResult} from 'types/apps';
|
import type {DoAppCallResult} from 'types/apps';
|
||||||
|
|
||||||
@@ -84,18 +82,11 @@ const AppBarBinding = (props: BindingComponentProps) => {
|
|||||||
const id = `app-bar-icon-${binding.app_id}`;
|
const id = `app-bar-icon-${binding.app_id}`;
|
||||||
const label = binding.label || binding.app_id;
|
const label = binding.label || binding.app_id;
|
||||||
|
|
||||||
const tooltip = (
|
|
||||||
<Tooltip id={'tooltip-' + id}>
|
|
||||||
<span>{label}</span>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
trigger={['hover', 'focus']}
|
id={'tooltip-' + id}
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
title={label}
|
||||||
placement='left'
|
placement='left'
|
||||||
overlay={tooltip}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
id={id}
|
id={id}
|
||||||
@@ -107,7 +98,7 @@ const AppBarBinding = (props: BindingComponentProps) => {
|
|||||||
<img src={binding.icon}/>
|
<img src={binding.icon}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user