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; collectionSummaryType: CollectionSummaryType;
} }
export function DownloadOption({ export function DownloadQuickOption({
handleCollectionAction, handleCollectionAction,
collectionSummaryType, collectionSummaryType,
}: Iprops) { }: Iprops) {

View file

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

View file

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

View file

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

View file

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