Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(gallery):change-hidden-to-disabled

Aswin Asok1b13fafaf1e6
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
index b9b2ac881d..a9772ac569 100644
--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
@@ -859,14 +859,14 @@ const QuickOptions: React.FC<QuickOptionsProps> = ({
{showEmptyTrashQuickOption(collectionSummary) && (
<EmptyTrashQuickOption onClick={onEmptyTrashClick} />
)}
- {!hasActiveFileSelection &&
- showDownloadQuickOption(collectionSummary) &&
+ {showDownloadQuickOption(collectionSummary) &&
collectionSummary.fileCount > 0 &&
(isDownloadInProgress() ? (
<ActivityIndicator size="20px" sx={{ m: "12px" }} />
) : (
<DownloadQuickOption
collectionSummary={collectionSummary}
+ disabled={hasActiveFileSelection}
onClick={onDownloadClick}
/>
))}
@@ -954,6 +954,7 @@ const shouldShowMapOption = ({ type, fileCount }: CollectionSummary) =>
type DownloadQuickOptionProps = OptionProps & {
collectionSummary: CollectionSummary;
+ disabled?: boolean;
};
const DownloadIcon: React.FC = () => (
@@ -975,6 +976,7 @@ const DownloadIcon: React.FC = () => (
const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
collectionSummary: { type },
+ disabled,
onClick,
}) => (
<Tooltip
@@ -988,19 +990,21 @@ const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
: t("download_album")
}
>
- <IconButton onClick={onClick}>
- <Box
- sx={{
- width: 24,
- height: 24,
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- }}
- >
- <DownloadIcon />
- </Box>
- </IconButton>
+ <span>
+ <IconButton disabled={disabled} onClick={onClick}>
+ <Box
+ sx={{
+ width: 24,
+ height: 24,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ }}
+ >
+ <DownloadIcon />
+ </Box>
+ </IconButton>
+ </span>
</Tooltip>
);