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

View file

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

View file

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

1
thirdparty/tesseract vendored Submodule

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