Adjust style for active menu item
This commit is contained in:
parent
f786b6f01b
commit
8699bba067
1 changed files with 5 additions and 3 deletions
|
@ -28,6 +28,10 @@ const StyledMenuItem = styled(MantineMenu.Item)<MenuItemProps>`
|
||||||
padding: 0.8rem;
|
padding: 0.8rem;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
font-family: var(--content-font-family);
|
font-family: var(--content-font-family);
|
||||||
|
background-color: ${({ $isActive }) => {
|
||||||
|
if (!$isActive) return undefined;
|
||||||
|
return 'var(--dropdown-menu-bg-hover)';
|
||||||
|
}};
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
|
@ -50,7 +54,6 @@ const StyledMenuItem = styled(MantineMenu.Item)<MenuItemProps>`
|
||||||
& .mantine-Menu-itemRightSection {
|
& .mantine-Menu-itemRightSection {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-left: 2rem !important;
|
margin-left: 2rem !important;
|
||||||
color: ${({ $isActive }) => ($isActive ? 'var(--primary-color)' : 'var(--dropdown-menu-fg)')};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -68,7 +71,6 @@ const StyledMenuDivider = styled(MantineMenu.Divider)`
|
||||||
export const DropdownMenu = ({ children, ...props }: MenuProps) => {
|
export const DropdownMenu = ({ children, ...props }: MenuProps) => {
|
||||||
return (
|
return (
|
||||||
<StyledMenu
|
<StyledMenu
|
||||||
withArrow
|
|
||||||
withinPortal
|
withinPortal
|
||||||
radius="sm"
|
radius="sm"
|
||||||
styles={{
|
styles={{
|
||||||
|
@ -76,7 +78,7 @@ export const DropdownMenu = ({ children, ...props }: MenuProps) => {
|
||||||
filter: 'drop-shadow(0 0 5px rgb(0, 0, 0, 50%))',
|
filter: 'drop-shadow(0 0 5px rgb(0, 0, 0, 50%))',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
transition="scale"
|
transition="scale-y"
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
Reference in a new issue