fixed component naming issue

This commit is contained in:
Ananddubey01 2023-02-21 18:12:33 +05:30
parent 46e1aaf1a5
commit 14182bd3ae
5 changed files with 14 additions and 18 deletions

View file

@ -12,7 +12,7 @@ interface Iprops {
collectionSummaryType: CollectionSummaryType;
}
export function DownloadOption({
export function DownloadQuickOption({
handleCollectionAction,
collectionSummaryType,
}: Iprops) {

View file

@ -11,7 +11,7 @@ interface Iprops {
) => (...args: any[]) => Promise<void>;
}
export function MoveToTrashOption({ handleCollectionAction }: Iprops) {
export function EmptyTrashQuickOption({ handleCollectionAction }: Iprops) {
return (
<Tooltip title={constants.EMPTY_TRASH}>
<IconButton

View file

@ -13,7 +13,7 @@ interface Iprops {
collectionSummaryType: CollectionSummaryType;
}
export function ShareOption({
export function ShareQuickOption({
handleCollectionAction,
collectionSummaryType,
}: Iprops) {

View file

@ -2,13 +2,13 @@ import { CollectionActions } from '..';
import React from 'react';
import { CollectionSummaryType } from 'constants/collection';
import { FlexWrapper } from 'components/Container';
import { MoveToTrashOption } from './EmptyTrashQuickOption';
import { DownloadOption } from './DownloadQuickOption';
import { ShareOption } from './ShareQuickOption';
import { EmptyTrashQuickOption } from './EmptyTrashQuickOption';
import { DownloadQuickOption } from './DownloadQuickOption';
import { ShareQuickOption } from './ShareQuickOption';
import {
showDownloadQuickOption,
showShareQuickOption,
showTrashQuickOption,
showEmptyTrashQuickOption,
} from 'utils/collection';
interface Iprops {
handleCollectionAction: (
@ -24,19 +24,19 @@ export function QuickOptions({
}: Iprops) {
return (
<FlexWrapper sx={{ gap: '16px' }}>
{showTrashQuickOption(collectionSummaryType) && (
<MoveToTrashOption
{showEmptyTrashQuickOption(collectionSummaryType) && (
<EmptyTrashQuickOption
handleCollectionAction={handleCollectionAction}
/>
)}
{showDownloadQuickOption(collectionSummaryType) && (
<DownloadOption
<DownloadQuickOption
handleCollectionAction={handleCollectionAction}
collectionSummaryType={collectionSummaryType}
/>
)}
{showShareQuickOption(collectionSummaryType) && (
<ShareOption
<ShareQuickOption
handleCollectionAction={handleCollectionAction}
collectionSummaryType={collectionSummaryType}
/>

View file

@ -194,28 +194,24 @@ export const isSystemCollection = (type: CollectionSummaryType) => {
export const shouldShowOptions = (type: CollectionSummaryType) => {
return !OPTIONS_NOT_HAVING_COLLECTION_TYPES.has(type);
};
export const showTrashQuickOption = (type: CollectionSummaryType) => {
export const showEmptyTrashQuickOption = (type: CollectionSummaryType) => {
return type === CollectionSummaryType.trash;
};
export const showDownloadQuickOption = (type: CollectionSummaryType) => {
return (
type === CollectionSummaryType.folder ||
type === CollectionSummaryType.album ||
type === CollectionSummaryType.all ||
type === CollectionSummaryType.incomingShare ||
type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
type === CollectionSummaryType.sharedOnlyViaLink
);
};
export const showShareQuickOption = (type: CollectionSummaryType) => {
return (
type === CollectionSummaryType.folder ||
type === CollectionSummaryType.album ||
type === CollectionSummaryType.all ||
type === CollectionSummaryType.outgoingShare ||
type === CollectionSummaryType.sharedOnlyViaLink ||
type === CollectionSummaryType.archived
type === CollectionSummaryType.sharedOnlyViaLink
);
};
export const shouldBeShownOnCollectionBar = (type: CollectionSummaryType) => {