Skip to content

Commit c48792d

Browse files
committed
fix: styling issue
Signed-off-by: amitamrutiya <[email protected]>
1 parent 12efa42 commit c48792d

File tree

4 files changed

+10
-27
lines changed

4 files changed

+10
-27
lines changed

src/custom/CatalogDesignTable/CatalogDesignTable.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import _ from 'lodash';
33
import { MUIDataTableColumn } from 'mui-datatables';
44
import { useCallback, useMemo, useRef } from 'react';
55
import { PublishIcon } from '../../icons';
6-
import { CHARCOAL, useTheme } from '../../theme';
6+
import { CHARCOAL } from '../../theme';
77
import { Pattern } from '../CustomCatalog/CustomCard';
88
import { ErrorBoundary } from '../ErrorBoundary';
99
import { ColView } from '../Helpers/ResponsiveColumns/responsive-coulmns.tsx/responsive-column';
@@ -52,10 +52,8 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
5252
handleBulkDeleteModal,
5353
setSearch,
5454
rowsPerPageOptions = [10, 25, 50, 100],
55-
tableBackgroundColor,
5655
handleBulkpatternsDataUnpublishModal
5756
}) => {
58-
const theme = useTheme();
5957
const modalRef = useRef<PromptRef>(null);
6058

6159
const formatDate = useCallback((date: string | Date): string => {
@@ -204,13 +202,6 @@ export const CatalogDesignsTable: React.FC<CatalogDesignsTableProps> = ({
204202
colViews={colViews}
205203
tableCols={processedColumns}
206204
columnVisibility={columnVisibility}
207-
backgroundColor={
208-
tableBackgroundColor
209-
? tableBackgroundColor
210-
: theme.palette.mode === 'light'
211-
? theme.palette.background.default
212-
: theme.palette.background.secondary
213-
}
214205
/>
215206
</ErrorBoundary>
216207
);

src/custom/CatalogDesignTable/DesignTableColumnConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export const createDesignsColumnsConfig = ({
247247
actionsList.splice(1, 0, publishAction);
248248
}
249249

250-
return <DataTableEllipsisMenu actionsList={actionsList} theme={theme} />;
250+
return <DataTableEllipsisMenu actionsList={actionsList} />;
251251
}
252252
}
253253
}

src/custom/ResponsiveDataTable.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Theme, styled } from '@mui/material/styles';
21
import MUIDataTable, { MUIDataTableColumn } from 'mui-datatables';
32
import React, { useCallback } from 'react';
43
import { Checkbox, Collapse, ListItemIcon, ListItemText, Menu, MenuItem } from '../base';
54
import { ShareIcon } from '../icons';
65
import { EllipsisIcon } from '../icons/Ellipsis';
6+
import { styled, useTheme } from './../theme';
77
import { ColView } from './Helpers/ResponsiveColumns/responsive-coulmns.tsx';
88
import { TooltipIcon } from './TooltipIconButton';
99

@@ -20,11 +20,10 @@ export const IconWrapper = styled('div', {
2020

2121
export 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>

src/custom/Workspaces/DesignTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ const DesignTable: React.FC<DesignTableProps> = ({
249249
}
250250
filter={'my-designs'}
251251
setSearch={setDesignSearch}
252-
tableBackgroundColor={theme.palette.background.constant?.table}
253252
/>
254253
</AccordionDetails>
255254
</Accordion>

0 commit comments

Comments
 (0)