Skip to content

Commit

Permalink
fix(styles): remove
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Aug 3, 2024
1 parent 717dacb commit a966aa8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions src/custom/ResponsiveDataTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Theme, ThemeProvider, createTheme, styled, useTheme } from '@mui/material';
import { Theme, ThemeProvider, createTheme, styled } from '@mui/material';
import MUIDataTable from 'mui-datatables';
import React, { useCallback } from 'react';
import { Collapse, ListItemIcon, ListItemText, Menu, MenuItem } from '../base';
Expand All @@ -20,7 +20,6 @@ export const DataTableEllipsisMenu: React.FC<{
}> = ({ actionsList }) => {
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const [isSocialShareOpen, setIsSocialShareOpen] = React.useState(false);
const theme = useTheme();

const handleClick = (event: React.MouseEvent<HTMLElement>) => {
setAnchorEl(event.currentTarget);
Expand All @@ -45,26 +44,16 @@ export const DataTableEllipsisMenu: React.FC<{
return (
<>
<TooltipIcon title="View Actions" onClick={handleClick} icon={<EllipsisIcon />} arrow />
<Menu
id="basic-menu"
anchorEl={anchorEl}
open={Boolean(anchorEl)}
onClose={handleClose}
sx={{
' .MuiPaper-root': {
background: theme.palette.background.surfaces
}
}}
>
<Menu id="basic-menu" anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={handleClose}>
{actionsList &&
actionsList.map((action, index) => (
<React.Fragment key={index}>
{action.type === 'share-social' ? (
<>
<MenuItem
sx={{
width: '-webkit-fill-available',
background: theme.palette.background.surfaces
width: '-webkit-fill-available'
// background: theme.palette.background.surfaces
}}
onClick={() => handleActionClick(action)}
disabled={action.disabled}
Expand All @@ -74,15 +63,17 @@ export const DataTableEllipsisMenu: React.FC<{
</ListItemIcon>
<ListItemText>{action.title}</ListItemText>
</MenuItem>
<Collapse in={isSocialShareOpen}>{action.customComponent}</Collapse>
<Collapse variant="submenu" in={isSocialShareOpen} unmountOnExit>
{action.customComponent}
</Collapse>
</>
) : (
<>
<IconWrapper key={index} disabled={action.disabled}>
<MenuItem
sx={{
width: '-webkit-fill-available',
background: theme.palette.background.surfaces
width: '-webkit-fill-available'
// background: theme.palette.background.surfaces
}}
key={index}
onClick={() => handleActionClick(action)}
Expand Down

0 comments on commit a966aa8

Please sign in to comment.