From 61325a4a6ce5b01f1ed7238bd69045c6a8727efe Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 29 Jun 2022 02:03:06 +0530 Subject: [PATCH] fix collection option for non album user collections --- .../Collections/CollectionInfoWithOptions.tsx | 7 +++++- .../Collections/CollectionOptions/index.tsx | 22 ++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/Collections/CollectionInfoWithOptions.tsx b/src/components/Collections/CollectionInfoWithOptions.tsx index f7caa7b95..e7c85047c 100644 --- a/src/components/Collections/CollectionInfoWithOptions.tsx +++ b/src/components/Collections/CollectionInfoWithOptions.tsx @@ -58,7 +58,12 @@ export default function CollectionInfoWithOptions({ fileCount={fileCount} endIcon={} /> - {shouldShowOptions(type) && } + {shouldShowOptions(type) && ( + + )} ); diff --git a/src/components/Collections/CollectionOptions/index.tsx b/src/components/Collections/CollectionOptions/index.tsx index 0c5f963ec..67943ddef 100644 --- a/src/components/Collections/CollectionOptions/index.tsx +++ b/src/components/Collections/CollectionOptions/index.tsx @@ -16,13 +16,13 @@ import { VISIBILITY_STATE } from 'types/magicMetadata'; import { AppContext } from 'pages/_app'; import OverflowMenu from 'components/OverflowMenu/menu'; import MoreVertIcon from '@mui/icons-material/MoreVert'; -import { CollectionType, TRASH_SECTION } from 'constants/collection'; +import { CollectionSummaryType } from 'constants/collection'; import { TrashCollectionOption } from './TrashCollectionOption'; interface CollectionOptionsProps { setCollectionNamerAttributes: SetCollectionNamerAttributes; activeCollection: Collection; - activeCollectionID: number; + collectionSummaryType: CollectionSummaryType; showCollectionShareModal: () => void; redirectToAll: () => void; } @@ -44,15 +44,12 @@ export enum CollectionActions { const CollectionOptions = (props: CollectionOptionsProps) => { const { activeCollection, - activeCollectionID, + collectionSummaryType, redirectToAll, setCollectionNamerAttributes, showCollectionShareModal, } = props; - if (!activeCollectionID) { - return <>; - } const { startLoading, finishLoading, setDialogMessage } = useContext(AppContext); const { syncWithRemote } = useContext(GalleryContext); @@ -205,21 +202,20 @@ const CollectionOptions = (props: CollectionOptionsProps) => { return ( } triggerButtonProps={{ sx: { background: (theme) => theme.palette.fill.dark, }, }}> - {activeCollection?.type === CollectionType.album && ( - - )} - {activeCollectionID === TRASH_SECTION && ( - )}