Skip to content

armgit / ente

Public Imported from GitHub
0

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

refactor(photos):inline-gallery-download-notifications

Aswin Asok26cdf5bd2a46
diff --git a/web/apps/photos/src/components/gallery/GalleryDownloadStatusNotifications.tsx b/web/apps/photos/src/components/gallery/GalleryDownloadStatusNotifications.tsx
deleted file mode 100644
index dac9e15d19..0000000000
--- a/web/apps/photos/src/components/gallery/GalleryDownloadStatusNotifications.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import {
- DownloadStatusNotifications,
- type DownloadStatusNotificationsProps,
-} from "ente-gallery/components/DownloadStatusNotifications";
-import { useCallback } from "react";
-import { usePhotosNavigation } from "./PhotosNavigationContext";
-
-export const GalleryDownloadStatusNotifications = (
- props: Omit<DownloadStatusNotificationsProps, "onShowCollectionSummary">,
-) => {
- const { showCollectionSummary } = usePhotosNavigation();
- const onShowCollectionSummary = useCallback(
- (id: number | undefined, isHidden: boolean | undefined) => {
- void showCollectionSummary(id, isHidden);
- },
- [showCollectionSummary],
- );
- return (
- <DownloadStatusNotifications
- {...props}
- onShowCollectionSummary={onShowCollectionSummary}
- />
- );
-};
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 3ad05351d6..3a216097ea 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -32,7 +32,6 @@ import {
} from "@/components/gallery";
import { AlbumsOverview } from "@/components/gallery/AlbumsOverview";
import { DuplicatesView } from "@/components/gallery/DuplicatesView";
-import { GalleryDownloadStatusNotifications } from "@/components/gallery/GalleryDownloadStatusNotifications";
import { LargeFilesView } from "@/components/gallery/LargeFilesView";
import { PeopleOverview } from "@/components/gallery/PeopleOverview";
import {
@@ -102,6 +101,7 @@ import {
import { savedAuthToken } from "ente-base/token";
import type { Location } from "ente-base/types";
import { initContacts, pullContacts } from "ente-contacts";
+import { DownloadStatusNotifications } from "ente-gallery/components/DownloadStatusNotifications";
import { FullScreenDropZone } from "ente-gallery/components/FullScreenDropZone";
import type { UploadTypeSelectorIntent } from "ente-gallery/components/Upload";
import {
@@ -2080,6 +2080,19 @@ const Page: React.FC = () => {
() => handleChangeBarMode("links"),
[handleChangeBarMode],
);
+ const handleDownloadStatusNotificationsShowCollectionSummary = useCallback(
+ (
+ collectionSummaryID: number | undefined,
+ isHiddenCollectionSummary: boolean | undefined,
+ ) => {
+ void showCollectionSummary(
+ collectionSummaryID,
+ isHiddenCollectionSummary,
+ );
+ },
+ [showCollectionSummary],
+ );
+
const navigationActions = useMemo<PhotosNavigationActions>(
() => ({
goHome: handleGoHome,
@@ -2177,8 +2190,11 @@ const Page: React.FC = () => {
findCollectionCreatingIfNeeded(state.collections, id)
}
/>
- <GalleryDownloadStatusNotifications
+ <DownloadStatusNotifications
{...{ saveGroups, onRemoveSaveGroup }}
+ onShowCollectionSummary={
+ handleDownloadStatusNotificationsShowCollectionSummary
+ }
/>
<FixCreationTime
{...fixCreationTimeVisibilityProps}