Skip to content

armgit / ente

Public Imported from GitHub
0

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

use newer

Manav Rathi35f7ce07f1a9
diff --git a/web/apps/photos/src/components/Collections/AllCollections/collectionCard.tsx b/web/apps/photos/src/components/Collections/AllCollections/collectionCard.tsx
deleted file mode 100644
index 0976c385b4..0000000000
--- a/web/apps/photos/src/components/Collections/AllCollections/collectionCard.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import {
- AllCollectionTile,
- LargeTileTextOverlay,
-} from "@/new/photos/components/ItemCards";
-import type { CollectionSummary } from "@/new/photos/types/collection";
-import { Typography } from "@mui/material";
-import { t } from "i18next";
-import CollectionCard from "../CollectionCard";
-
-interface Iprops {
- collectionSummary: CollectionSummary;
- onCollectionClick: (collectionID: number) => void;
- isScrolling?: boolean;
-}
-
-export default function AllCollectionCard({
- onCollectionClick,
- collectionSummary,
- isScrolling,
-}: Iprops) {
- return (
- <CollectionCard
- collectionTile={AllCollectionTile}
- coverFile={collectionSummary.coverFile}
- onClick={() => onCollectionClick(collectionSummary.id)}
- isScrolling={isScrolling}
- >
- <LargeTileTextOverlay>
- <Typography>{collectionSummary.name}</Typography>
- <Typography variant="small" color="text.muted">
- {t("photos_count", { count: collectionSummary.fileCount })}
- </Typography>
- </LargeTileTextOverlay>
- </CollectionCard>
- );
-}
diff --git a/web/apps/photos/src/components/Collections/AllCollections/content.tsx b/web/apps/photos/src/components/Collections/AllCollections/content.tsx
index e2fdd8355b..5f4ea2c160 100644
--- a/web/apps/photos/src/components/Collections/AllCollections/content.tsx
+++ b/web/apps/photos/src/components/Collections/AllCollections/content.tsx
@@ -1,7 +1,12 @@
+import {
+ ItemCard,
+ LargeTileTextOverlay,
+} from "@/new/photos/components/ItemCards";
import type { CollectionSummary } from "@/new/photos/types/collection";
import { FlexWrapper } from "@ente/shared/components/Container";
import useWindowSize from "@ente/shared/hooks/useWindowSize";
-import { DialogContent } from "@mui/material";
+import { DialogContent, Typography } from "@mui/material";
+import { t } from "i18next";
import memoize from "memoize-one";
import React, { useEffect, useRef, useState } from "react";
import {
@@ -9,13 +14,13 @@ import {
ListChildComponentProps,
areEqual,
} from "react-window";
-import AllCollectionCard from "./collectionCard";
import { AllCollectionMobileBreakpoint } from "./dialog";
const MobileColumns = 2;
const DesktopColumns = 3;
const CollectionRowItemSize = 154;
+
const getCollectionRowListHeight = (
collectionRowList: CollectionSummary[][],
windowSize: { height: number; width: number },
@@ -147,3 +152,29 @@ export default function AllCollectionContent({
</DialogContent>
);
}
+
+interface AllCollectionCardProps {
+ collectionSummary: CollectionSummary;
+ onCollectionClick: (collectionID: number) => void;
+ isScrolling?: boolean;
+}
+
+const AllCollectionCard: React.FC<AllCollectionCardProps> = ({
+ onCollectionClick,
+ collectionSummary,
+ isScrolling,
+}) => (
+ <ItemCard
+ TileComponent={AllCollectionTile}
+ coverFile={collectionSummary.coverFile}
+ onClick={() => onCollectionClick(collectionSummary.id)}
+ isScrolling={isScrolling}
+ >
+ <LargeTileTextOverlay>
+ <Typography>{collectionSummary.name}</Typography>
+ <Typography variant="small" color="text.muted">
+ {t("photos_count", { count: collectionSummary.fileCount })}
+ </Typography>
+ </LargeTileTextOverlay>
+ </ItemCard>
+);