parent
910fc4a881
commit
85314c9367
3 changed files with 83 additions and 33 deletions
@ -0,0 +1,44 @@ |
||||
import { |
||||
MenuItem as MUIMenuItem, |
||||
menuItemClasses as muiMenuItemClasses, |
||||
MenuItemProps as MUIMenuItemProps, |
||||
} from '@mui/material'; |
||||
|
||||
import { GREY, TEXT } from '../lib/consts/DEFAULT_THEME'; |
||||
|
||||
const MenuItem = (menuItemProps: MUIMenuItemProps): JSX.Element => { |
||||
const { children, sx } = menuItemProps; |
||||
const combinedSx = { |
||||
backgroundColor: TEXT, |
||||
paddingRight: '3em', |
||||
|
||||
[`&.${muiMenuItemClasses.selected}`]: { |
||||
backgroundColor: GREY, |
||||
fontWeight: 400, |
||||
|
||||
'&:hover': { |
||||
backgroundColor: GREY, |
||||
}, |
||||
}, |
||||
|
||||
'&:hover': { |
||||
backgroundColor: GREY, |
||||
}, |
||||
|
||||
...sx, |
||||
}; |
||||
|
||||
return ( |
||||
<MUIMenuItem |
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...{ |
||||
...menuItemProps, |
||||
sx: combinedSx, |
||||
}} |
||||
> |
||||
{children} |
||||
</MUIMenuItem> |
||||
); |
||||
}; |
||||
|
||||
export default MenuItem; |
@ -0,0 +1,32 @@ |
||||
import { |
||||
Select as MUISelect, |
||||
selectClasses as muiSelectClasses, |
||||
SelectProps as MUISelectProps, |
||||
} from '@mui/material'; |
||||
|
||||
import { GREY } from '../lib/consts/DEFAULT_THEME'; |
||||
|
||||
const Select = (selectProps: MUISelectProps): JSX.Element => { |
||||
const { children, sx } = selectProps; |
||||
const combinedSx = { |
||||
[`& .${muiSelectClasses.icon}`]: { |
||||
color: GREY, |
||||
}, |
||||
|
||||
...sx, |
||||
}; |
||||
|
||||
return ( |
||||
<MUISelect |
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...{ |
||||
...selectProps, |
||||
sx: combinedSx, |
||||
}} |
||||
> |
||||
{children} |
||||
</MUISelect> |
||||
); |
||||
}; |
||||
|
||||
export default Select; |
Loading…
Reference in new issue