options in shared collection added

This commit is contained in:
Ananddubey01 2023-01-10 11:03:19 +05:30
parent 645c8c05c9
commit 54786e278c
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,27 @@
import { OverflowMenuOption } from 'components/OverflowMenu/option';
import React from 'react';
import DeleteOutlinedIcon from '@mui/icons-material/DeleteOutlined';
import constants from 'utils/strings/constants';
import { CollectionActions } from '.';
interface Iprops {
handleCollectionAction: (
action: CollectionActions,
loader?: boolean
) => (...args: any[]) => Promise<void>;
}
export function SharedCollectionOption({ handleCollectionAction }: Iprops) {
return (
<OverflowMenuOption
color="danger"
startIcon={<DeleteOutlinedIcon />}
onClick={handleCollectionAction(
CollectionActions.CONFIRM_EMPTY_TRASH,
false
)}>
{constants.LEAVE}
</OverflowMenuOption>
);
}

View file

@ -17,6 +17,7 @@ import { AppContext } from 'pages/_app';
import OverflowMenu from 'components/OverflowMenu/menu'; import OverflowMenu from 'components/OverflowMenu/menu';
import { CollectionSummaryType } from 'constants/collection'; import { CollectionSummaryType } from 'constants/collection';
import { TrashCollectionOption } from './TrashCollectionOption'; import { TrashCollectionOption } from './TrashCollectionOption';
import { SharedCollectionOption } from './SharedCollectionOption';
import MoreHoriz from '@mui/icons-material/MoreHoriz'; import MoreHoriz from '@mui/icons-material/MoreHoriz';
interface CollectionOptionsProps { interface CollectionOptionsProps {
@ -213,6 +214,10 @@ const CollectionOptions = (props: CollectionOptionsProps) => {
<TrashCollectionOption <TrashCollectionOption
handleCollectionAction={handleCollectionAction} handleCollectionAction={handleCollectionAction}
/> />
) : collectionSummaryType === CollectionSummaryType.shared ? (
<SharedCollectionOption
handleCollectionAction={handleCollectionAction}
/>
) : ( ) : (
<AlbumCollectionOption <AlbumCollectionOption
IsArchived={IsArchived(activeCollection)} IsArchived={IsArchived(activeCollection)}