Skip to content

Commit 9330ea6

Browse files
committed
fix(style): styles
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
1 parent 1b6b6fc commit 9330ea6

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/custom/ResponsiveDataTable.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Theme, ThemeProvider, createTheme, styled } from '@mui/material';
1+
import { Theme, ThemeProvider, createTheme, styled, useTheme } from '@mui/material';
22
import MUIDataTable from 'mui-datatables';
33
import React, { useCallback } from 'react';
4-
import { Menu, MenuItem } from '../base';
4+
import { ListItemIcon, ListItemText, Menu, MenuItem } from '../base';
55
import { EllipsisIcon } from '../icons/Ellipsis';
66
import TooltipIcon from './TooltipIcon';
77

@@ -14,11 +14,6 @@ export const IconWrapper = styled('div')<{ disabled?: boolean }>(({ disabled = f
1414
}
1515
}));
1616

17-
const CustomMenuItem = styled(MenuItem)(() => ({
18-
paddingLeft: '0px',
19-
padding: '10px'
20-
}));
21-
2217
export const DataTableEllipsisMenu: React.FC<{
2318
actionsList: NonNullable<Column['options']>['actionsList'];
2419
}> = ({ actionsList }) => {
@@ -30,26 +25,34 @@ export const DataTableEllipsisMenu: React.FC<{
3025
setAnchorEl(null);
3126
};
3227

28+
const theme = useTheme();
29+
3330
return (
3431
<>
3532
<TooltipIcon title="View Actions" onClick={handleClick} icon={<EllipsisIcon />} arrow />
3633
<Menu
34+
id="basic-menu"
3735
anchorEl={anchorEl}
3836
open={Boolean(anchorEl)}
3937
onClose={handleClose}
40-
PaperProps={{
41-
style: {
42-
maxHeight: 48 * 4.5
38+
sx={{
39+
' .MuiPaper-root': {
40+
background: theme.palette.background.surfaces
4341
}
4442
}}
4543
>
4644
{actionsList &&
4745
actionsList.map((action, index) => (
4846
<IconWrapper key={index} disabled={action.disabled}>
49-
<CustomMenuItem key={index} onClick={action.onClick} disabled={action.disabled}>
50-
{action.icon}
51-
{action.title}
52-
</CustomMenuItem>
47+
<MenuItem
48+
sx={{ width: '-webkit-fill-available' }}
49+
key={index}
50+
onClick={action.onClick}
51+
disabled={action.disabled}
52+
>
53+
<ListItemIcon>{action.icon}</ListItemIcon>
54+
<ListItemText>{action.title}</ListItemText>
55+
</MenuItem>
5356
</IconWrapper>
5457
))}
5558
</Menu>

0 commit comments

Comments
 (0)