Moved toolTip logic inside the leave component

This commit is contained in:
Ananddubey01 2023-02-15 20:25:04 +05:30
parent 9953d09f44
commit a3fc5d7a1a
4 changed files with 29 additions and 28 deletions

View file

@ -3,21 +3,29 @@ import React from 'react';
import FileDownloadOutlinedIcon from '@mui/icons-material/FileDownloadOutlined';
import { IconButton, Tooltip } from '@mui/material';
import constants from 'utils/strings/constants';
import { CollectionSummaryType } from 'constants/collection';
interface Iprops {
handleCollectionAction: (
action: CollectionActions,
loader?: boolean
) => (...args: any[]) => Promise<void>;
tooltipTitle?: String;
collectionSummaryType: CollectionSummaryType;
}
export function DownloadOption({
handleCollectionAction,
tooltipTitle = constants.DOWNLOAD_COLLECTION,
collectionSummaryType,
}: Iprops) {
return (
<Tooltip title={tooltipTitle}>
<Tooltip
title={
collectionSummaryType === CollectionSummaryType.favorites
? constants.DOWNLOAD_FAVORITES
: collectionSummaryType ===
CollectionSummaryType.uncategorized
? constants.DOWNLOAD_UNCATEGORIZED
: constants.DOWNLOAD_COLLECTION
}>
<IconButton
onClick={handleCollectionAction(
CollectionActions.CONFIRM_DOWNLOAD,

View file

@ -3,21 +3,32 @@ import React from 'react';
import PeopleIcon from '@mui/icons-material/People';
import { IconButton, Tooltip } from '@mui/material';
import constants from 'utils/strings/constants';
import { CollectionSummaryType } from 'constants/collection';
interface Iprops {
handleCollectionAction: (
action: CollectionActions,
loader?: boolean
) => (...args: any[]) => Promise<void>;
tooltipTitle?: string;
collectionSummaryType: CollectionSummaryType;
}
export function ShareOption({
handleCollectionAction,
tooltipTitle = constants.SHARE_COLLECTION,
collectionSummaryType,
}: Iprops) {
return (
<Tooltip title={tooltipTitle}>
<Tooltip
title={
/*: collectionSummaryType ===
CollectionSummaryType.incomingShare
? constants.SHARING_DETAILS*/
collectionSummaryType === CollectionSummaryType.outgoingShare ||
collectionSummaryType ===
CollectionSummaryType.sharedOnlyViaLink
? constants.MODIFY_SHARING
: constants.SHARE_COLLECTION
}>
<IconButton
onClick={handleCollectionAction(
CollectionActions.SHOW_SHARE_DIALOG,

View file

@ -2,7 +2,6 @@ import { CollectionActions } from '..';
import React from 'react';
import { CollectionSummaryType } from 'constants/collection';
import { FlexWrapper } from 'components/Container';
import constants from 'utils/strings/constants';
import { MoveToTrashOption } from './MoveToTrashOption';
import { DownloadOption } from './DownloadOption';
import { ShareOption } from './ShareOption';
@ -33,31 +32,13 @@ export function QuickOptions({
{showDownloadQuickOption(collectionSummaryType) && (
<DownloadOption
handleCollectionAction={handleCollectionAction}
tooltipTitle={
collectionSummaryType ===
CollectionSummaryType.favorites
? constants.DOWNLOAD_FAVORITES
: collectionSummaryType ===
CollectionSummaryType.uncategorized
? constants.DOWNLOAD_UNCATEGORIZED
: constants.DOWNLOAD_COLLECTION
}
collectionSummaryType={collectionSummaryType}
/>
)}
{showShareQuickOption(collectionSummaryType) && (
<ShareOption
handleCollectionAction={handleCollectionAction}
tooltipTitle={
/*: collectionSummaryType ===
CollectionSummaryType.incomingShare
? constants.SHARING_DETAILS*/
collectionSummaryType ===
CollectionSummaryType.outgoingShare ||
collectionSummaryType ===
CollectionSummaryType.sharedOnlyViaLink
? constants.MODIFY_SHARING
: constants.SHARE_COLLECTION
}
collectionSummaryType={collectionSummaryType}
/>
)}
</FlexWrapper>

1
thirdparty/tesseract vendored Submodule

@ -0,0 +1 @@
Subproject commit 73b42f8cb0bc36aee08a837b4ea70c919edab4cc