1- import { Theme , ThemeProvider , createTheme , styled , useTheme } from '@mui/material' ;
1+ import { Theme , ThemeProvider , createTheme , styled } from '@mui/material' ;
22import MUIDataTable from 'mui-datatables' ;
33import React , { useCallback } from 'react' ;
44import { Collapse , ListItemIcon , ListItemText , Menu , MenuItem } from '../base' ;
@@ -20,7 +20,6 @@ export const DataTableEllipsisMenu: React.FC<{
2020} > = ( { actionsList } ) => {
2121 const [ anchorEl , setAnchorEl ] = React . useState < null | HTMLElement > ( null ) ;
2222 const [ isSocialShareOpen , setIsSocialShareOpen ] = React . useState ( false ) ;
23- const theme = useTheme ( ) ;
2423
2524 const handleClick = ( event : React . MouseEvent < HTMLElement > ) => {
2625 setAnchorEl ( event . currentTarget ) ;
@@ -45,26 +44,16 @@ export const DataTableEllipsisMenu: React.FC<{
4544 return (
4645 < >
4746 < TooltipIcon title = "View Actions" onClick = { handleClick } icon = { < EllipsisIcon /> } arrow />
48- < Menu
49- id = "basic-menu"
50- anchorEl = { anchorEl }
51- open = { Boolean ( anchorEl ) }
52- onClose = { handleClose }
53- sx = { {
54- ' .MuiPaper-root' : {
55- background : theme . palette . background . surfaces
56- }
57- } }
58- >
47+ < Menu id = "basic-menu" anchorEl = { anchorEl } open = { Boolean ( anchorEl ) } onClose = { handleClose } >
5948 { actionsList &&
6049 actionsList . map ( ( action , index ) => (
6150 < React . Fragment key = { index } >
6251 { action . type === 'share-social' ? (
6352 < >
6453 < MenuItem
6554 sx = { {
66- width : '-webkit-fill-available' ,
67- background : theme . palette . background . surfaces
55+ width : '-webkit-fill-available'
56+ // background: theme.palette.background.surfaces
6857 } }
6958 onClick = { ( ) => handleActionClick ( action ) }
7059 disabled = { action . disabled }
@@ -74,15 +63,17 @@ export const DataTableEllipsisMenu: React.FC<{
7463 </ ListItemIcon >
7564 < ListItemText > { action . title } </ ListItemText >
7665 </ MenuItem >
77- < Collapse in = { isSocialShareOpen } > { action . customComponent } </ Collapse >
66+ < Collapse variant = "submenu" in = { isSocialShareOpen } unmountOnExit >
67+ { action . customComponent }
68+ </ Collapse >
7869 </ >
7970 ) : (
8071 < >
8172 < IconWrapper key = { index } disabled = { action . disabled } >
8273 < MenuItem
8374 sx = { {
84- width : '-webkit-fill-available' ,
85- background : theme . palette . background . surfaces
75+ width : '-webkit-fill-available'
76+ // background: theme.palette.background.surfaces
8677 } }
8778 key = { index }
8879 onClick = { ( ) => handleActionClick ( action ) }
0 commit comments