changed the check of collectionSummaryType for share and download quickOptions

This commit is contained in:
Ananddubey01 2023-02-15 21:12:32 +05:30
parent 3523f3bda9
commit 3a3647c06b
2 changed files with 17 additions and 7 deletions

View file

@ -2,7 +2,7 @@ import { CollectionActions } from '..';
import React from 'react';
import { CollectionSummaryType } from 'constants/collection';
import { FlexWrapper } from 'components/Container';
import { MoveToTrashOption } from './MoveToTrashQuickOption';
import { MoveToTrashOption } from './EmptyTrashQuickOption';
import { DownloadOption } from './DownloadQuickOption';
import { ShareOption } from './ShareQuickOption';
import {

View file

@ -199,14 +199,24 @@ export const showTrashQuickOption = (type: CollectionSummaryType) => {
return type === CollectionSummaryType.trash;
};
export const showDownloadQuickOption = (type: CollectionSummaryType) => {
return !(type === CollectionSummaryType.trash);
return (
type === CollectionSummaryType.folder ||
type === CollectionSummaryType.album ||
type === CollectionSummaryType.all ||
type === CollectionSummaryType.incomingShare ||
type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
);
};
export const showShareQuickOption = (type: CollectionSummaryType) => {
return !(
type === CollectionSummaryType.trash ||
type === CollectionSummaryType.favorites ||
type === CollectionSummaryType.uncategorized ||
type === CollectionSummaryType.incomingShare
return (
type === CollectionSummaryType.folder ||
type === CollectionSummaryType.album ||
type === CollectionSummaryType.all ||
type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
);
};
export const shouldBeShownOnCollectionBar = (type: CollectionSummaryType) => {