Skip to content

Commit 1b6b6fc

Browse files
committed
fix(tooltip): styles
Signed-off-by: Sudhanshu Dasgupta <dasguptashivam23@gmail.com>
1 parent a0284a6 commit 1b6b6fc

4 files changed

Lines changed: 32 additions & 9 deletions

File tree

src/custom/ResponsiveDataTable.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Theme, ThemeProvider, createTheme, styled } from '@mui/material';
22
import MUIDataTable from 'mui-datatables';
33
import React, { useCallback } from 'react';
4-
import { IconButton, Menu, MenuItem } from '../base';
5-
import { DropDownIcon } from '../icons';
4+
import { Menu, MenuItem } from '../base';
5+
import { EllipsisIcon } from '../icons/Ellipsis';
6+
import TooltipIcon from './TooltipIcon';
67

78
export const IconWrapper = styled('div')<{ disabled?: boolean }>(({ disabled = false }) => ({
89
cursor: disabled ? 'not-allowed' : 'pointer',
@@ -22,7 +23,7 @@ export const DataTableEllipsisMenu: React.FC<{
2223
actionsList: NonNullable<Column['options']>['actionsList'];
2324
}> = ({ actionsList }) => {
2425
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
25-
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
26+
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
2627
setAnchorEl(event.currentTarget);
2728
};
2829
const handleClose = () => {
@@ -31,9 +32,7 @@ export const DataTableEllipsisMenu: React.FC<{
3132

3233
return (
3334
<>
34-
<IconButton onClick={handleClick}>
35-
<DropDownIcon />
36-
</IconButton>
35+
<TooltipIcon title="View Actions" onClick={handleClick} icon={<EllipsisIcon />} arrow />
3736
<Menu
3837
anchorEl={anchorEl}
3938
open={Boolean(anchorEl)}

src/custom/TooltipIcon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SxProps } from '@mui/material/styles';
22
import React from 'react';
33
import { IconButton } from '../base/IconButton';
4-
import Tooltip from '../patches/Tooltip';
4+
import { CustomTooltip } from './CustomTooltip';
55

66
interface TooltipIconProps {
77
title: string;
@@ -19,7 +19,7 @@ export function TooltipIcon({
1919
arrow = false
2020
}: TooltipIconProps): JSX.Element {
2121
return (
22-
<Tooltip title={title} arrow={arrow}>
22+
<CustomTooltip title={title} arrow={arrow}>
2323
<IconButton
2424
onClick={onClick}
2525
sx={{
@@ -35,7 +35,7 @@ export function TooltipIcon({
3535
>
3636
{icon}
3737
</IconButton>
38-
</Tooltip>
38+
</CustomTooltip>
3939
);
4040
}
4141

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
2+
import { IconProps } from '../types';
3+
4+
export const EllipsisIcon = ({
5+
width = DEFAULT_WIDTH,
6+
height = DEFAULT_HEIGHT,
7+
...props
8+
}: IconProps): JSX.Element => {
9+
return (
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
viewBox="0 -960 960 960"
13+
width={width}
14+
height={height}
15+
fill={props.fill || 'currentColor'}
16+
{...props}
17+
>
18+
<path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z" />
19+
</svg>
20+
);
21+
};
22+
23+
export default EllipsisIcon;

src/icons/Ellipsis/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as EllipsisIcon } from './Ellipsisicon';

0 commit comments

Comments
 (0)