Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename

Manav Rathid7806d344107
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsx
index e09bbe5b0c..0e95d2920e 100644
--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx
+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx
@@ -31,7 +31,7 @@ import {
ListChildComponentProps,
} from "react-window";
-interface AllCollectionsProps {
+interface AllAlbums {
open: boolean;
onClose: () => void;
collectionSummaries: CollectionSummary[];
@@ -41,7 +41,10 @@ interface AllCollectionsProps {
isInHiddenSection: boolean;
}
-export const AllCollections: React.FC<AllCollectionsProps> = ({
+/**
+ * A modal showing the list of all the albums.
+ */
+export const AllAlbums: React.FC<AllAlbums> = ({
collectionSummaries,
open,
onClose,
@@ -58,12 +61,12 @@ export const AllCollections: React.FC<AllCollectionsProps> = ({
};
return (
- <AllCollectionDialog
+ <AllAlbumsDialog
{...{ open, onClose, fullScreen }}
slots={{ transition: SlideUpTransition }}
fullWidth
>
- <AllCollectionsHeader
+ <Title
{...{
isInHiddenSection,
onClose,
@@ -73,17 +76,17 @@ export const AllCollections: React.FC<AllCollectionsProps> = ({
collectionCount={collectionSummaries.length}
/>
<Divider />
- <AllCollectionContent
+ <AllAlbumsContent
collectionSummaries={collectionSummaries}
onCollectionClick={onCollectionClick}
/>
- </AllCollectionDialog>
+ </AllAlbumsDialog>
);
};
export const AllCollectionMobileBreakpoint = 559;
-const AllCollectionDialog = styled(Dialog)(({ theme }) => ({
+const AllAlbumsDialog = styled(Dialog)(({ theme }) => ({
"& .MuiDialog-container": {
justifyContent: "flex-end",
},
@@ -107,7 +110,7 @@ const AllCollectionDialog = styled(Dialog)(({ theme }) => ({
},
}));
-const AllCollectionsHeader = ({
+const Title = ({
onClose,
collectionCount,
collectionsSortBy,
@@ -182,7 +185,7 @@ const createItemData = memoize((collectionRowList, onCollectionClick) => ({
// Consider using React.memo or shouldComponentUpdate to avoid unnecessary re-renders.
// https://reactjs.org/docs/react-api.html#reactmemo
// https://reactjs.org/docs/react-api.html#reactpurecomponent
-const AllCollectionRow = React.memo(
+const AlbumsRow = React.memo(
({
data,
index,
@@ -195,7 +198,7 @@ const AllCollectionRow = React.memo(
<div style={style}>
<FlexWrapper gap={"4px"} padding={"16px"}>
{collectionRow.map((item: any) => (
- <CollectionButton
+ <AlbumCard
isScrolling={isScrolling}
onCollectionClick={onCollectionClick}
collectionSummary={item}
@@ -209,11 +212,12 @@ const AllCollectionRow = React.memo(
areEqual,
);
-interface AllCollectionContentProps {
+interface AllAlbumsContentProps {
collectionSummaries: CollectionSummary[];
onCollectionClick: (id?: number) => void;
}
-const AllCollectionContent: React.FC<AllCollectionContentProps> = ({
+
+const AllAlbumsContent: React.FC<AllAlbumsContentProps> = ({
collectionSummaries,
onCollectionClick,
}) => {
@@ -279,19 +283,19 @@ const AllCollectionContent: React.FC<AllCollectionContentProps> = ({
itemSize={CollectionRowItemSize}
itemData={itemData}
>
- {AllCollectionRow}
+ {AlbumsRow}
</List>
</DialogContent>
);
};
-interface AllCollectionCardProps {
+interface AlbumCardProps {
collectionSummary: CollectionSummary;
onCollectionClick: (collectionID: number) => void;
isScrolling?: boolean;
}
-const CollectionButton: React.FC<AllCollectionCardProps> = ({
+const AlbumCard: React.FC<AlbumCardProps> = ({
onCollectionClick,
collectionSummary,
isScrolling,
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index fbceadaf7f..751d97ca56 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -20,7 +20,7 @@ import {
LS_KEYS,
removeData,
} from "@ente/shared/storage/localStorage";
-import { AllCollections } from "components/Collections/AllAlbums";
+import { AllAlbums } from "components/Collections/AllAlbums";
import { SetCollectionNamerAttributes } from "components/Collections/CollectionNamer";
import { CollectionShare } from "components/Collections/CollectionShare";
import { ITEM_TYPE, TimeStampListItem } from "components/PhotoList";
@@ -42,7 +42,7 @@ type CollectionsProps = Omit<
| "onSelectCollectionID"
| "collectionsSortBy"
| "onChangeCollectionsSortBy"
- | "onShowAllCollections"
+ | "onShowAllAlbums"
> & {
/**
* When `true`, the bar is be hidden altogether.
@@ -93,7 +93,7 @@ export const GalleryBarAndListHeader: React.FC<CollectionsProps> = ({
filesDownloadProgressAttributesList,
setFilesDownloadProgressAttributesCreator,
}) => {
- const { show: showAllCollections, props: allCollectionsVisibilityProps } =
+ const { show: showAllAlbums, props: allAlbumsVisibilityProps } =
useModalVisibility();
const { show: showCollectionShare, props: collectionShareVisibilityProps } =
useModalVisibility();
@@ -202,14 +202,14 @@ export const GalleryBarAndListHeader: React.FC<CollectionsProps> = ({
}}
onSelectCollectionID={setActiveCollectionID}
onChangeCollectionsSortBy={setCollectionsSortBy}
- onShowAllCollections={showAllCollections}
+ onShowAllAlbums={showAllAlbums}
collectionSummaries={sortedCollectionSummaries.filter((x) =>
shouldShowOnCollectionBar(x.type),
)}
/>
- <AllCollections
- {...allCollectionsVisibilityProps}
+ <AllAlbums
+ {...allAlbumsVisibilityProps}
collectionSummaries={sortedCollectionSummaries.filter(
(x) => !isSystemCollection(x.type),
)}
diff --git a/web/packages/new/photos/components/gallery/BarImpl.tsx b/web/packages/new/photos/components/gallery/BarImpl.tsx
index 2e315e9aec..1f9a1e9edb 100644
--- a/web/packages/new/photos/components/gallery/BarImpl.tsx
+++ b/web/packages/new/photos/components/gallery/BarImpl.tsx
@@ -72,9 +72,9 @@ export interface GalleryBarImplProps {
onSelectCollectionID: (collectionID: number) => void;
/**
* Called when the user selects the option to show a modal with all the
- * collections.
+ * albums.
*/
- onShowAllCollections: () => void;
+ onShowAllAlbums: () => void;
/**
* The scheme that should be used for sorting the collections in the bar.
*/
@@ -103,7 +103,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
collectionSummaries,
activeCollectionID,
onSelectCollectionID,
- onShowAllCollections,
+ onShowAllAlbums,
collectionsSortBy,
onChangeCollectionsSortBy,
people,
@@ -229,7 +229,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
onChangeSortBy={onChangeCollectionsSortBy}
transparentTriggerButtonBackground
/>
- <IconButton onClick={onShowAllCollections}>
+ <IconButton onClick={onShowAllAlbums}>
<ExpandMoreIcon />
</IconButton>
</>
@@ -246,7 +246,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
activeSortBy={collectionsSortBy}
onChangeSortBy={onChangeCollectionsSortBy}
/>
- <FilledIconButton onClick={onShowAllCollections}>
+ <FilledIconButton onClick={onShowAllAlbums}>
<ExpandMoreIcon />
</FilledIconButton>
</Stack>