Skip to content

armgit / ente

Public Imported from GitHub
0

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

use newer

Manav Rathi25386d194bc0
diff --git a/web/apps/photos/src/components/Collections/AllCollections/content.tsx b/web/apps/photos/src/components/Collections/AllCollections/content.tsx
index 5f4ea2c160..d2a34aed6f 100644
--- a/web/apps/photos/src/components/Collections/AllCollections/content.tsx
+++ b/web/apps/photos/src/components/Collections/AllCollections/content.tsx
@@ -1,4 +1,5 @@
import {
+ AllCollectionTile,
ItemCard,
LargeTileTextOverlay,
} from "@/new/photos/components/ItemCards";
diff --git a/web/apps/photos/src/components/Collections/CollectionSelector/CollectionCard.tsx b/web/apps/photos/src/components/Collections/CollectionSelector/CollectionCard.tsx
deleted file mode 100644
index c65994509e..0000000000
--- a/web/apps/photos/src/components/Collections/CollectionSelector/CollectionCard.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import {
- AllCollectionTile,
- LargeTileTextOverlay,
-} from "@/new/photos/components/ItemCards";
-import type { CollectionSummary } from "@/new/photos/types/collection";
-import { Typography } from "@mui/material";
-import CollectionCard from "../CollectionCard";
-
-interface Iprops {
- collectionSummary: CollectionSummary;
- onCollectionClick: (collectionID: number) => void;
-}
-
-export default function CollectionSelectorCard({
- onCollectionClick,
- collectionSummary,
-}: Iprops) {
- return (
- <CollectionCard
- collectionTile={AllCollectionTile}
- coverFile={collectionSummary.coverFile}
- onClick={() => onCollectionClick(collectionSummary.id)}
- >
- <LargeTileTextOverlay>
- <Typography>{collectionSummary.name}</Typography>
- </LargeTileTextOverlay>
- </CollectionCard>
- );
-}
diff --git a/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx b/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx
index 00e584620c..e7c6756383 100644
--- a/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx
@@ -1,11 +1,16 @@
import type { Collection } from "@/media/collection";
+import {
+ AllCollectionTile,
+ ItemCard,
+ LargeTileTextOverlay,
+} from "@/new/photos/components/ItemCards";
import type {
CollectionSummaries,
CollectionSummary,
} from "@/new/photos/types/collection";
import { FlexWrapper } from "@ente/shared/components/Container";
import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton";
-import { DialogContent, useMediaQuery } from "@mui/material";
+import { DialogContent, Typography, useMediaQuery } from "@mui/material";
import { AllCollectionDialog } from "components/Collections/AllCollections/dialog";
import { t } from "i18next";
import { useEffect, useState } from "react";
@@ -18,7 +23,6 @@ import {
isMoveToAllowedCollection,
} from "utils/collection";
import AddCollectionButton from "./AddCollectionButton";
-import CollectionSelectorCard from "./CollectionCard";
export interface CollectionSelectorAttributes {
callback: (collection: Collection) => void;
@@ -146,9 +150,9 @@ function CollectionSelector({
/>
{collectionsToShow.map((collectionSummary) => (
<CollectionSelectorCard
- onCollectionClick={handleCollectionClick}
- collectionSummary={collectionSummary}
key={collectionSummary.id}
+ collectionSummary={collectionSummary}
+ onCollectionClick={handleCollectionClick}
/>
))}
</FlexWrapper>
@@ -158,3 +162,23 @@ function CollectionSelector({
}
export default CollectionSelector;
+
+interface CollectionSelectorCardProps {
+ collectionSummary: CollectionSummary;
+ onCollectionClick: (collectionID: number) => void;
+}
+
+const CollectionSelectorCard: React.FC<CollectionSelectorCardProps> = ({
+ collectionSummary,
+ onCollectionClick,
+}) => (
+ <ItemCard
+ TileComponent={AllCollectionTile}
+ coverFile={collectionSummary.coverFile}
+ onClick={() => onCollectionClick(collectionSummary.id)}
+ >
+ <LargeTileTextOverlay>
+ <Typography>{collectionSummary.name}</Typography>
+ </LargeTileTextOverlay>
+ </ItemCard>
+);