Skip to content

Commit

Permalink
refactor: replace CustomToolTip with TooltipHelpContent
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed May 28, 2024
1 parent c527775 commit 6ba9413
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 194 deletions.
188 changes: 0 additions & 188 deletions src/component/elements/CustomToolTip.tsx

This file was deleted.

16 changes: 10 additions & 6 deletions src/component/toolbar/ToolBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ import {
FaFileExport,
} from 'react-icons/fa';
import { PiKnifeBold } from 'react-icons/pi';
import { Toolbar, ToolbarItemProps } from 'react-science/ui';
import {
Toolbar,
ToolbarItemProps,
TooltipItem,
TooltipHelpContent,
} from 'react-science/ui';

import { useChartData } from '../context/ChartContext';
import { useDispatch } from '../context/DispatchContext';
import { useLoader } from '../context/LoaderContext';
import { usePreferences } from '../context/PreferencesContext';
import { CustomToolTip, ToolTipItem } from '../elements/CustomToolTip';
import {
ToolbarPopoverMenuItem,
ToolbarPopoverItem,
Expand Down Expand Up @@ -60,12 +64,12 @@ interface BaseToolItem extends Pick<ToolbarItemProps, 'icon'> {
}
interface ToolItem extends BaseToolItem {
onClick?: () => void;
tooltip: string | ToolTipItem;
tooltip: string | TooltipItem;
}
interface PopoverToolItem extends BaseToolItem {
onClick: (data?: any) => void;
menuItems: ToolbarPopoverMenuItem[];
tooltip: string | ToolTipItem;
tooltip: string | TooltipItem;
}

function isPopoverToolItem(
Expand Down Expand Up @@ -452,7 +456,7 @@ export default function ToolBar() {
typeof tooltip === 'string' ? (
tooltip
) : (
<CustomToolTip {...tooltip} />
<TooltipHelpContent {...tooltip} />
)
}
tooltipProps={{
Expand All @@ -476,7 +480,7 @@ export default function ToolBar() {
typeof tooltip === 'string' ? (
tooltip
) : (
<CustomToolTip {...tooltip} />
<TooltipHelpContent {...tooltip} />
)
}
tooltipProps={{
Expand Down

0 comments on commit 6ba9413

Please sign in to comment.