fixed component naming issue
This commit is contained in:
parent
46e1aaf1a5
commit
14182bd3ae
|
@ -12,7 +12,7 @@ interface Iprops {
|
|||
collectionSummaryType: CollectionSummaryType;
|
||||
}
|
||||
|
||||
export function DownloadOption({
|
||||
export function DownloadQuickOption({
|
||||
handleCollectionAction,
|
||||
collectionSummaryType,
|
||||
}: Iprops) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -13,7 +13,7 @@ interface Iprops {
|
|||
collectionSummaryType: CollectionSummaryType;
|
||||
}
|
||||
|
||||
export function ShareOption({
|
||||
export function ShareQuickOption({
|
||||
handleCollectionAction,
|
||||
collectionSummaryType,
|
||||
}: Iprops) {
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue