Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Inline

Manav Rathiffa1d90ed8c3
diff --git a/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/ShareQuickOption.tsx b/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/ShareQuickOption.tsx
deleted file mode 100644
index 4d9565c32a..0000000000
--- a/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/ShareQuickOption.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-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 "..";
-
-interface Iprops {
- handleCollectionAction: (
- action: CollectionActions,
- loader?: boolean,
- ) => (...args: any[]) => Promise<void>;
- collectionSummaryType: CollectionSummaryType;
-}
-
-export function ShareQuickOption({
- handleCollectionAction,
- collectionSummaryType,
-}: Iprops) {
- return (
- <Tooltip
- title={
- collectionSummaryType ===
- CollectionSummaryType.incomingShareViewer ||
- collectionSummaryType ===
- CollectionSummaryType.incomingShareCollaborator
- ? t("SHARING_DETAILS")
- : collectionSummaryType ===
- CollectionSummaryType.outgoingShare ||
- collectionSummaryType ===
- CollectionSummaryType.sharedOnlyViaLink
- ? t("MODIFY_SHARING")
- : t("SHARE_COLLECTION")
- }
- >
- <IconButton
- onClick={handleCollectionAction(
- CollectionActions.SHOW_SHARE_DIALOG,
- false,
- )}
- >
- <PeopleIcon />
- </IconButton>
- </Tooltip>
- );
-}
diff --git a/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/index.tsx b/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/index.tsx
index 65af430f46..9b0e1069db 100644
--- a/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/index.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionOptions/QuickOptions/index.tsx
@@ -1,10 +1,12 @@
import { FlexWrapper } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
+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";
import { EmptyTrashQuickOption } from "./EmptyTrashQuickOption";
-import { ShareQuickOption } from "./ShareQuickOption";
interface QuickOptionsProps {
handleCollectionAction: (
@@ -49,6 +51,7 @@ export const QuickOptions: React.FC<QuickOptionsProps> = ({
const showEmptyTrashQuickOption = (type: CollectionSummaryType) => {
return type === CollectionSummaryType.trash;
};
+
const showDownloadQuickOption = (type: CollectionSummaryType) => {
return (
type === CollectionSummaryType.folder ||
@@ -64,6 +67,7 @@ const showDownloadQuickOption = (type: CollectionSummaryType) => {
type === CollectionSummaryType.pinned
);
};
+
const showShareQuickOption = (type: CollectionSummaryType) => {
return (
type === CollectionSummaryType.folder ||
@@ -76,3 +80,41 @@ const showShareQuickOption = (type: CollectionSummaryType) => {
type === CollectionSummaryType.pinned
);
};
+
+interface ShareQuickOptionProps {
+ handleCollectionAction: (
+ action: CollectionActions,
+ loader?: boolean,
+ ) => (...args: any[]) => Promise<void>;
+ collectionSummaryType: CollectionSummaryType;
+}
+
+const ShareQuickOption: React.FC<ShareQuickOptionProps> = ({
+ handleCollectionAction,
+ collectionSummaryType,
+}) => (
+ <Tooltip
+ title={
+ collectionSummaryType ===
+ CollectionSummaryType.incomingShareViewer ||
+ collectionSummaryType ===
+ CollectionSummaryType.incomingShareCollaborator
+ ? t("SHARING_DETAILS")
+ : collectionSummaryType ===
+ CollectionSummaryType.outgoingShare ||
+ collectionSummaryType ===
+ CollectionSummaryType.sharedOnlyViaLink
+ ? t("MODIFY_SHARING")
+ : t("SHARE_COLLECTION")
+ }
+ >
+ <IconButton
+ onClick={handleCollectionAction(
+ CollectionActions.SHOW_SHARE_DIALOG,
+ false,
+ )}
+ >
+ <PeopleIcon />
+ </IconButton>
+ </Tooltip>
+);