Inline
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
|
||||
import { IconButton, Tooltip } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import { CollectionSummaryType } from "types/collection";
|
||||
import { CollectionActions } from "..";
|
||||
interface Iprops {
|
||||
handleCollectionAction: (
|
||||
action: CollectionActions,
|
||||
loader?: boolean,
|
||||
) => (...args: any[]) => Promise<void>;
|
||||
collectionSummaryType: CollectionSummaryType;
|
||||
}
|
||||
|
||||
export function DownloadQuickOption({
|
||||
handleCollectionAction,
|
||||
collectionSummaryType,
|
||||
}: Iprops) {
|
||||
return (
|
||||
<Tooltip
|
||||
title={
|
||||
collectionSummaryType === CollectionSummaryType.favorites
|
||||
? t("DOWNLOAD_FAVORITES")
|
||||
: collectionSummaryType ===
|
||||
CollectionSummaryType.uncategorized
|
||||
? t("DOWNLOAD_UNCATEGORIZED")
|
||||
: collectionSummaryType ===
|
||||
CollectionSummaryType.hiddenItems
|
||||
? t("DOWNLOAD_HIDDEN_ITEMS")
|
||||
: t("DOWNLOAD_COLLECTION")
|
||||
}
|
||||
>
|
||||
<IconButton
|
||||
onClick={handleCollectionAction(
|
||||
CollectionActions.DOWNLOAD,
|
||||
false,
|
||||
)}
|
||||
>
|
||||
<FileDownloadOutlinedIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import { FlexWrapper } from "@ente/shared/components/Container";
|
||||
import EnteSpinner from "@ente/shared/components/EnteSpinner";
|
||||
import DeleteOutlinedIcon from "@mui/icons-material/DeleteOutlined";
|
||||
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
|
||||
import PeopleIcon from "@mui/icons-material/People";
|
||||
import { IconButton, Tooltip } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import { CollectionSummaryType } from "types/collection";
|
||||
import { CollectionActions } from "..";
|
||||
import { DownloadQuickOption } from "./DownloadQuickOption";
|
||||
|
||||
interface QuickOptionsProps {
|
||||
handleCollectionAction: (
|
||||
@@ -90,6 +90,37 @@ const showDownloadQuickOption = (type: CollectionSummaryType) => {
|
||||
);
|
||||
};
|
||||
|
||||
interface DownloadQuickOptionProps {
|
||||
handleCollectionAction: (
|
||||
action: CollectionActions,
|
||||
loader?: boolean,
|
||||
) => (...args: any[]) => Promise<void>;
|
||||
collectionSummaryType: CollectionSummaryType;
|
||||
}
|
||||
|
||||
const DownloadQuickOption: React.FC<DownloadQuickOptionProps> = ({
|
||||
handleCollectionAction,
|
||||
collectionSummaryType,
|
||||
}) => (
|
||||
<Tooltip
|
||||
title={
|
||||
collectionSummaryType === CollectionSummaryType.favorites
|
||||
? t("DOWNLOAD_FAVORITES")
|
||||
: collectionSummaryType === CollectionSummaryType.uncategorized
|
||||
? t("DOWNLOAD_UNCATEGORIZED")
|
||||
: collectionSummaryType === CollectionSummaryType.hiddenItems
|
||||
? t("DOWNLOAD_HIDDEN_ITEMS")
|
||||
: t("DOWNLOAD_COLLECTION")
|
||||
}
|
||||
>
|
||||
<IconButton
|
||||
onClick={handleCollectionAction(CollectionActions.DOWNLOAD, false)}
|
||||
>
|
||||
<FileDownloadOutlinedIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
const showShareQuickOption = (type: CollectionSummaryType) => {
|
||||
return (
|
||||
type === CollectionSummaryType.folder ||
|
||||
|
||||
Reference in New Issue
Block a user