Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

added support for disabled enteMenuItem

Abhinav38211c234382
diff --git a/apps/photos/src/components/Menu/EnteMenuItem.tsx b/apps/photos/src/components/Menu/EnteMenuItem.tsx
index df8d5c39b1..7393870a28 100644
--- a/apps/photos/src/components/Menu/EnteMenuItem.tsx
+++ b/apps/photos/src/components/Menu/EnteMenuItem.tsx
@@ -22,6 +22,7 @@ interface Iprops {
subIcon?: React.ReactNode;
checked?: boolean;
labelComponent?: React.ReactNode;
+ disabled?: boolean;
}
export function EnteMenuItem({
onClick,
@@ -35,6 +36,7 @@ export function EnteMenuItem({
variant = 'primary',
fontWeight = 'bold',
labelComponent,
+ disabled = false,
}: Iprops) {
const handleClick = () => {
onClick();
@@ -42,10 +44,12 @@ export function EnteMenuItem({
return (
<MenuItem
+ disabled={disabled}
onClick={handleClick}
sx={{
width: '100%',
- color: (theme) => theme.palette[color].main,
+ color: (theme) =>
+ variant !== 'captioned' && theme.palette[color].main,
...(variant !== 'secondary' &&
variant !== 'mini' && {
backgroundColor: (theme) => theme.colors.fill.faint,
@@ -67,6 +71,7 @@ export function EnteMenuItem({
labelComponent
) : variant === 'captioned' ? (
<CaptionedText
+ color={color}
mainText={label}
subText={subText}
subIcon={subIcon}
diff --git a/apps/photos/src/themes/components.ts b/apps/photos/src/themes/components.ts
index d2bb0496eb..f5570fcf5c 100644
--- a/apps/photos/src/themes/components.ts
+++ b/apps/photos/src/themes/components.ts
@@ -180,6 +180,16 @@ export const getComponents = (
},
},
},
+ MuiMenuItem: {
+ styleOverrides: {
+ // don't reduce opacity of disabled items
+ root: {
+ '&.Mui-disabled': {
+ opacity: 1,
+ },
+ },
+ },
+ },
});
const getDropShadowStyle = (shadows: Shadow[]) => {