Skip to content

armgit / ente

Public Imported from GitHub
0

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

rename

Manav Rathi4d56b4b406d9
diff --git a/web/apps/photos/src/components/Collections/index.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
similarity index 89%
rename from web/apps/photos/src/components/Collections/index.tsx
rename to web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index f00ca653f6..69c211aeb8 100644
--- a/web/apps/photos/src/components/Collections/index.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -59,15 +59,24 @@ type CollectionsProps = Omit<
};
/**
- * The horizontally scrollable bar shown at the top of the gallery.
+ * The gallery bar, the header for the list items, and state for any associated
+ * dialogs that might be triggered by actions on either the bar or the header..
*
- * This component includes both the actual bar, and also the surrounding chrome
- * and state for any associated dialogs that might be triggered by actions on
- * the bar.
+ * This component manages the sticky horizontally scrollable bar shown at the
+ * top of the gallery, AND the non-sticky header shown below the bar, at the top
+ * of the actual list of items.
+ *
+ * These are disparate views - indeed, the list header is not even a child of
+ * this component but is instead proxied via {@link setPhotoListHeader}. Still,
+ * having this intermediate wrapper component allows us to move some of the
+ * common concerns shared by both the gallery bar and list header (e.g. some
+ * dialogs that can be invoked from both places) into this file instead of
+ * cluttering the already big gallery component.
+ *
+ * TODO: Once the gallery code is better responsibilitied out, consider moving
+ * this code back inline into the gallery.
*/
-// TODO-Cluster - Rename me to GalleryBar and subsume GalleryBarImpl - Or rename
-// to GalleryBarAndHeader.
-export const Collections: React.FC<CollectionsProps> = ({
+export const GalleryBarAndListHeader: React.FC<CollectionsProps> = ({
shouldHide,
mode,
onChangeMode,
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 0748a2fa03..cd04293049 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -58,7 +58,6 @@ import MenuIcon from "@mui/icons-material/Menu";
import type { ButtonProps, IconButtonProps } from "@mui/material";
import { Box, Button, IconButton, Typography } from "@mui/material";
import AuthenticateUserModal from "components/AuthenticateUserModal";
-import { Collections } from "components/Collections";
import CollectionNamer, {
CollectionNamerAttributes,
} from "components/Collections/CollectionNamer";
@@ -66,6 +65,7 @@ import {
CollectionSelector,
CollectionSelectorAttributes,
} from "components/Collections/CollectionSelector";
+import { GalleryBarAndListHeader } from "components/Collections/GalleryBarAndListHeader";
import ExportModal from "components/ExportModal";
import {
FilesDownloadProgress,
@@ -1130,7 +1130,7 @@ export default function Gallery() {
)}
</NavbarBase>
- <Collections
+ <GalleryBarAndListHeader
{...{
shouldHide: isInSearchMode,
mode: barMode,