1- import { Theme , styled } from '@mui/material/styles' ;
21import MUIDataTable , { MUIDataTableColumn } from 'mui-datatables' ;
32import React , { useCallback } from 'react' ;
43import { Checkbox , Collapse , ListItemIcon , ListItemText , Menu , MenuItem } from '../base' ;
54import { ShareIcon } from '../icons' ;
65import { EllipsisIcon } from '../icons/Ellipsis' ;
6+ import { styled , useTheme } from './../theme' ;
77import { ColView } from './Helpers/ResponsiveColumns/responsive-coulmns.tsx' ;
88import { TooltipIcon } from './TooltipIconButton' ;
99
@@ -20,11 +20,10 @@ export const IconWrapper = styled('div', {
2020
2121export const DataTableEllipsisMenu : React . FC < {
2222 actionsList : NonNullable < Column [ 'options' ] > [ 'actionsList' ] ;
23- theme ?: Theme ;
24- } > = ( { actionsList, theme } ) => {
23+ } > = ( { actionsList } ) => {
2524 const [ anchorEl , setAnchorEl ] = React . useState < null | HTMLElement > ( null ) ;
2625 const [ isSocialShareOpen , setIsSocialShareOpen ] = React . useState ( false ) ;
27-
26+ const theme = useTheme ( ) ;
2827 const handleClick = ( event : React . MouseEvent < HTMLElement > ) => {
2928 setAnchorEl ( event . currentTarget ) ;
3029 } ;
@@ -50,7 +49,7 @@ export const DataTableEllipsisMenu: React.FC<{
5049 < TooltipIcon
5150 title = "View Actions"
5251 onClick = { handleClick }
53- icon = { < EllipsisIcon fill = { theme ? .palette . icon . default ?? 'black' } /> }
52+ icon = { < EllipsisIcon fill = { theme . palette . icon . default } /> }
5453 arrow
5554 />
5655 < Menu
@@ -59,9 +58,8 @@ export const DataTableEllipsisMenu: React.FC<{
5958 open = { Boolean ( anchorEl ) }
6059 onClose = { handleClose }
6160 sx = { {
62- fontFamily : theme ?. typography . fontFamily ,
6361 '& .MuiPaper-root' : {
64- backgroundColor : theme ? .palette . background . card ?? 'white'
62+ backgroundColor : theme . palette . background . card
6563 }
6664 } }
6765 >
@@ -73,19 +71,14 @@ export const DataTableEllipsisMenu: React.FC<{
7371 key = { `${ index } -menuitem` }
7472 sx = { {
7573 width : '-webkit-fill-available'
76- // background: theme.palette.background.surfaces
7774 } }
7875 onClick = { ( ) => handleActionClick ( action ) }
7976 disabled = { action . disabled }
8077 >
8178 < ListItemIcon >
82- < ShareIcon
83- width = { 24 }
84- height = { 24 }
85- fill = { theme ?. palette . text . primary ?? 'black' }
86- />
79+ < ShareIcon width = { 24 } height = { 24 } fill = { theme . palette . text . primary } />
8780 </ ListItemIcon >
88- < ListItemText sx = { { color : theme ? .palette . text . primary ?? 'black' } } >
81+ < ListItemText sx = { { color : theme . palette . text . primary } } >
8982 { action . title }
9083 </ ListItemText >
9184 </ MenuItem > ,
@@ -109,7 +102,7 @@ export const DataTableEllipsisMenu: React.FC<{
109102 disabled = { action . disabled }
110103 >
111104 < ListItemIcon > { action . icon } </ ListItemIcon >
112- < ListItemText sx = { { color : theme ? .palette . text . primary ?? 'black' } } >
105+ < ListItemText sx = { { color : theme . palette . text . primary } } >
113106 { action . title }
114107 </ ListItemText >
115108 </ MenuItem >
0 commit comments