[MM-59336] Migrate tooltips of "components/global_header/right_controls/plan_upgrade_button/index.tsx" to WithTooltip (#27612)
Этот коммит содержится в:
@@ -13,10 +13,9 @@ import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/user
|
|||||||
|
|
||||||
import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal';
|
import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal';
|
||||||
import type {TelemetryProps} from 'components/common/hooks/useOpenPricingModal';
|
import type {TelemetryProps} from 'components/common/hooks/useOpenPricingModal';
|
||||||
import OverlayTrigger from 'components/overlay_trigger';
|
import WithTooltip from 'components/with_tooltip';
|
||||||
import Tooltip from 'components/tooltip';
|
|
||||||
|
|
||||||
import Constants, {CloudProducts} from 'utils/constants';
|
import {CloudProducts} from 'utils/constants';
|
||||||
|
|
||||||
const UpgradeButton = styled.button`
|
const UpgradeButton = styled.button`
|
||||||
background: var(--denim-button-bg);
|
background: var(--denim-button-bg);
|
||||||
@@ -83,18 +82,11 @@ const PlanUpgradeButton = (): JSX.Element | null => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltip = (
|
|
||||||
<Tooltip id='upgrade_button_tooltip'>
|
|
||||||
{formatMessage({id: 'pricing_modal.btn.tooltip', defaultMessage: 'Only visible to system admins'})}
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
trigger={['hover']}
|
id='upgrade_button_tooltip'
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
title={formatMessage({id: 'pricing_modal.btn.tooltip', defaultMessage: 'Only visible to system admins'})}
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
overlay={tooltip}
|
|
||||||
>
|
>
|
||||||
<UpgradeButton
|
<UpgradeButton
|
||||||
id='UpgradeButton'
|
id='UpgradeButton'
|
||||||
@@ -103,7 +95,7 @@ const PlanUpgradeButton = (): JSX.Element | null => {
|
|||||||
>
|
>
|
||||||
{formatMessage({id: 'pricing_modal.btn.viewPlans', defaultMessage: 'View plans'})}
|
{formatMessage({id: 'pricing_modal.btn.viewPlans', defaultMessage: 'View plans'})}
|
||||||
</UpgradeButton>
|
</UpgradeButton>
|
||||||
</OverlayTrigger>);
|
</WithTooltip>);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PlanUpgradeButton;
|
export default PlanUpgradeButton;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user