@ -79,6 +79,7 @@ export const MenuItem = ({
|
|||||||
LeftIcon={LeftIcon ?? undefined}
|
LeftIcon={LeftIcon ?? undefined}
|
||||||
text={text}
|
text={text}
|
||||||
contextualText={contextualText}
|
contextualText={contextualText}
|
||||||
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
</StyledMenuItemLeftContent>
|
</StyledMenuItemLeftContent>
|
||||||
<div className="hoverable-buttons">
|
<div className="hoverable-buttons">
|
||||||
@ -89,7 +90,7 @@ export const MenuItem = ({
|
|||||||
{RightIcon && (
|
{RightIcon && (
|
||||||
<RightIcon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
|
<RightIcon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
|
||||||
)}
|
)}
|
||||||
{hasSubMenu && (
|
{hasSubMenu && !disabled && (
|
||||||
<IconChevronRight
|
<IconChevronRight
|
||||||
size={theme.icon.size.sm}
|
size={theme.icon.size.sm}
|
||||||
color={theme.font.color.tertiary}
|
color={theme.font.color.tertiary}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export const MenuItemDraggable = ({
|
|||||||
<MenuItemLeftContent
|
<MenuItemLeftContent
|
||||||
LeftIcon={LeftIcon}
|
LeftIcon={LeftIcon}
|
||||||
text={text}
|
text={text}
|
||||||
isDisabled={isDragDisabled}
|
disabled={isDragDisabled}
|
||||||
showGrip={showGrip}
|
showGrip={showGrip}
|
||||||
/>
|
/>
|
||||||
{showIconButtons && (
|
{showIconButtons && (
|
||||||
|
|||||||
@ -19,7 +19,7 @@ const StyledMainText = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledContextualText = styled.div`
|
const StyledContextualText = styled.div`
|
||||||
color: ${({ theme }) => theme.color.gray35};
|
color: ${({ theme }) => theme.font.color.light};
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
|
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
@ -40,7 +40,7 @@ type MenuItemLeftContentProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
LeftIcon: IconComponent | null | undefined;
|
LeftIcon: IconComponent | null | undefined;
|
||||||
showGrip?: boolean;
|
showGrip?: boolean;
|
||||||
isDisabled?: boolean;
|
disabled?: boolean;
|
||||||
text: ReactNode;
|
text: ReactNode;
|
||||||
contextualText?: ReactNode;
|
contextualText?: ReactNode;
|
||||||
};
|
};
|
||||||
@ -51,7 +51,7 @@ export const MenuItemLeftContent = ({
|
|||||||
text,
|
text,
|
||||||
contextualText,
|
contextualText,
|
||||||
showGrip = false,
|
showGrip = false,
|
||||||
isDisabled = false,
|
disabled = false,
|
||||||
}: MenuItemLeftContentProps) => {
|
}: MenuItemLeftContentProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ export const MenuItemLeftContent = ({
|
|||||||
size={theme.icon.size.md}
|
size={theme.icon.size.md}
|
||||||
stroke={theme.icon.stroke.sm}
|
stroke={theme.icon.stroke.sm}
|
||||||
color={
|
color={
|
||||||
isDisabled ? theme.font.color.extraLight : theme.font.color.light
|
disabled ? theme.font.color.extraLight : theme.font.color.light
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</StyledDraggableItem>
|
</StyledDraggableItem>
|
||||||
|
|||||||
@ -43,7 +43,11 @@ export const StyledMenuItemBase = styled.div<MenuItemBaseProps>`
|
|||||||
(disabled || isHoverBackgroundDisabled) ?? HOVER_BACKGROUND};
|
(disabled || isHoverBackgroundDisabled) ?? HOVER_BACKGROUND};
|
||||||
|
|
||||||
${({ theme, accent, disabled }) => {
|
${({ theme, accent, disabled }) => {
|
||||||
const isDisabled = !isUndefined(disabled) && disabled !== false;
|
if (!isUndefined(disabled) && disabled !== false) {
|
||||||
|
return css`
|
||||||
|
color: ${theme.font.color.tertiary};
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
switch (accent) {
|
switch (accent) {
|
||||||
case 'danger': {
|
case 'danger': {
|
||||||
@ -52,20 +56,17 @@ export const StyledMenuItemBase = styled.div<MenuItemBaseProps>`
|
|||||||
&:hover {
|
&:hover {
|
||||||
background: ${theme.background.transparent.danger};
|
background: ${theme.background.transparent.danger};
|
||||||
}
|
}
|
||||||
${isDisabled && `opacity: 0.4;`}
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
case 'placeholder': {
|
case 'placeholder': {
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.font.color.tertiary};
|
color: ${theme.font.color.tertiary};
|
||||||
${isDisabled && `opacity: 0.4;`}
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
case 'default':
|
case 'default':
|
||||||
default: {
|
default: {
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.font.color.secondary};
|
color: ${theme.font.color.secondary};
|
||||||
${isDisabled && `opacity: 0.4;`}
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user