Skip to content

Commit a46d674

Browse files
committed
refactor: remove unused theme import and simplify StyledDiv props
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent 9231e4f commit a46d674

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/custom/VisibilityChipMenu/VisibilityChipMenu.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
2-
import { Theme, useTheme } from '@mui/material';
32
import { MouseEvent, useState } from 'react';
43
import { Button, Menu, MenuItem } from '../../base';
54
import { iconXSmall } from '../../constants/iconsSizes';
@@ -49,7 +48,11 @@ const StyledButton = styled(Button)(() => ({
4948
padding: '0px'
5049
}));
5150

52-
const StyledDiv = styled('div')(({ theme, enabled }: { theme: Theme; enabled: boolean }) => ({
51+
interface StyledDivProps {
52+
enabled: boolean;
53+
}
54+
55+
const StyledDiv = styled('div')<StyledDivProps>(({ theme, enabled }) => ({
5356
paddingLeft: '0.3rem',
5457
height: '1.5rem',
5558
width: 'auto',
@@ -100,15 +103,15 @@ const VisibilityChipMenu: React.FC<VisibilityChipMenuProps> = ({
100103
}
101104
close(e);
102105
};
103-
const theme = useTheme();
106+
104107
return (
105108
<>
106109
<StyledButton
107110
disabled={!enabled}
108111
onClick={handleOpen}
109112
data-testid={`design-visibility-${value.toLowerCase()}`}
110113
>
111-
<StyledDiv theme={theme} enabled={enabled}>
114+
<StyledDiv enabled={enabled}>
112115
<span style={{ fontSize: '0.85rem' }}>{value}</span>
113116
{enabled && <ArrowDropDownIcon style={{ ...iconXSmall }} />}
114117
</StyledDiv>

0 commit comments

Comments
 (0)