Skip to content

Commit

Permalink
feat(CompositeBar): use uikit ActionTooltip instead of Tooltip (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunory authored Mar 27, 2024
1 parent 06e26ef commit 4673f8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/components/CompositeBar/Item/Item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ $block: '.#{variables.$ns}composite-bar-item';
var(--gn-aside-header-general-item-icon-color, var(--_--item-general-icon-color))
);
}

// FIXME: fix hack in the next major
&-tooltip .g-action-tooltip__description {
color: var(--g-color-text-light-primary);
margin-block-start: 0px;
}
}

&__icon-place {
Expand Down
9 changes: 5 additions & 4 deletions src/components/CompositeBar/Item/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {Icon, List, Popup, PopupPlacement, PopupProps, Tooltip} from '@gravity-ui/uikit';
import {ActionTooltip, Icon, List, Popup, PopupPlacement, PopupProps} from '@gravity-ui/uikit';

import {useAsideHeaderContext} from '../../AsideHeader/AsideHeaderContext';
import {ASIDE_HEADER_ICON_SIZE} from '../../constants';
Expand Down Expand Up @@ -136,8 +136,9 @@ export const Item: React.FC<ItemInnerProps> = (props) => {

const makeIconNode = (iconEl: React.ReactNode): React.ReactNode => {
return compact ? (
<Tooltip
content={tooltipText}
<ActionTooltip
title=""
description={tooltipText}
disabled={!enableTooltip || (collapsedItem && open) || popupVisible}
placement="right"
className={b('icon-tooltip', {'item-type': type})}
Expand All @@ -149,7 +150,7 @@ export const Item: React.FC<ItemInnerProps> = (props) => {
>
{iconEl}
</div>
</Tooltip>
</ActionTooltip>
) : (
iconEl
);
Expand Down

0 comments on commit 4673f8c

Please sign in to comment.