options in shared collection added
This commit is contained in:
parent
645c8c05c9
commit
54786e278c
|
@ -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>
|
||||||
|
);
|
||||||
|
}
|
|
@ -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)}
|
||||||
|
|
Loading…
Reference in a new issue