Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(CollectionHeader):added-trash

Aswin Asok0ae7c6fe6545
diff --git a/web/apps/photos/src/components/Collections/CollectionHeader.tsx b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
index 0fd3990245..a154dd7e46 100644
--- a/web/apps/photos/src/components/Collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionHeader.tsx
@@ -1,4 +1,4 @@
-import { CleanIcon } from "@hugeicons/core-free-icons";
+import { CleanIcon, Delete02Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import ArchiveOutlinedIcon from "@mui/icons-material/ArchiveOutlined";
import CheckIcon from "@mui/icons-material/Check";
@@ -796,7 +796,7 @@ const showEmptyTrashQuickOption = ({ type }: CollectionSummary) =>
const EmptyTrashQuickOption: React.FC<OptionProps> = ({ onClick }) => (
<Tooltip title={t("empty_trash")}>
<IconButton onClick={onClick}>
- <DeleteOutlinedIcon />
+ <HugeiconsIcon icon={Delete02Icon} size={22} strokeWidth={1.5} />
</IconButton>
</Tooltip>
);
@@ -985,7 +985,9 @@ const ShareQuickOption: React.FC<ShareQuickOptionProps> = ({
const EmptyTrashOption: React.FC<OptionProps> = ({ onClick }) => (
<OverflowMenuOption
color="critical"
- startIcon={<DeleteOutlinedIcon />}
+ startIcon={
+ <HugeiconsIcon icon={Delete02Icon} size={20} strokeWidth={1.5} />
+ }
onClick={onClick}
>
{t("empty_trash")}
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index dc738fb4ff..f27d21285b 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -159,44 +159,51 @@ export const GalleryBarAndListHeader: React.FC<
const collectionSummary = toShowCollectionSummaries.get(
activeCollectionID!,
);
+ // Render the full CollectionHeader for pseudo-collections (e.g. trash)
+ // so header actions/menus are available even without a real collection.
+ const shouldRenderCollectionHeader =
+ mode != "people" &&
+ collectionSummary &&
+ (activeCollection ||
+ collectionSummary.id <= PseudoCollectionID.all);
+
setFileListHeader({
- component:
- mode != "people" && activeCollection ? (
- <CollectionHeader
- {...{
- activeCollection,
- setActiveCollectionID,
- isActiveCollectionDownloadInProgress,
- onRemotePull,
- onAddSaveGroup,
- onMarkTempDeleted,
- onAddFileToCollection,
- onRemoteFilesPull,
- onVisualFeedback,
- fileNormalCollectionIDs,
- collectionNameByID,
- onSelectCollection,
- onSelectPerson,
- }}
- collectionSummary={collectionSummary!}
- onCollectionShare={showCollectionShare}
- onCollectionCast={showCollectionCast}
- />
- ) : mode != "people" && collectionSummary ? (
- <GalleryItemsHeaderAdapter>
- <GalleryItemsSummary
- name={collectionSummary.name}
- fileCount={collectionSummary.fileCount}
- />
- </GalleryItemsHeaderAdapter>
- ) : activePerson ? (
- <PeopleHeader
- person={activePerson}
- {...{ onSelectPerson, people }}
+ component: shouldRenderCollectionHeader ? (
+ <CollectionHeader
+ {...{
+ activeCollection,
+ setActiveCollectionID,
+ isActiveCollectionDownloadInProgress,
+ onRemotePull,
+ onAddSaveGroup,
+ onMarkTempDeleted,
+ onAddFileToCollection,
+ onRemoteFilesPull,
+ onVisualFeedback,
+ fileNormalCollectionIDs,
+ collectionNameByID,
+ onSelectCollection,
+ onSelectPerson,
+ }}
+ collectionSummary={collectionSummary!}
+ onCollectionShare={showCollectionShare}
+ onCollectionCast={showCollectionCast}
+ />
+ ) : mode != "people" && collectionSummary ? (
+ <GalleryItemsHeaderAdapter>
+ <GalleryItemsSummary
+ name={collectionSummary.name}
+ fileCount={collectionSummary.fileCount}
/>
- ) : (
- <></>
- ),
+ </GalleryItemsHeaderAdapter>
+ ) : activePerson ? (
+ <PeopleHeader
+ person={activePerson}
+ {...{ onSelectPerson, people }}
+ />
+ ) : (
+ <></>
+ ),
height: 68,
});
// eslint-disable-next-line react-hooks/exhaustive-deps