Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathi125685225979
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 898932b45f..5889db9b31 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -13,7 +13,6 @@ import {
import { FixCreationTime } from "components/FixCreationTime";
import { Sidebar } from "components/Sidebar";
import { Upload } from "components/Upload";
-import SelectedFileOptions from "components/pages/gallery/SelectedFileOptions";
import { sessionExpiredDialogAttributes } from "ente-accounts/components/utils/dialog";
import { stashRedirect } from "ente-accounts/services/redirect";
import { isSessionInvalid } from "ente-accounts/services/session";
@@ -49,6 +48,10 @@ import {
SearchBar,
type SearchBarProps,
} from "ente-new/photos/components/SearchBar";
+import SelectedFileOptions, {
+ type CollectionOp,
+ type FileOp,
+} from "ente-new/photos/components/SelectedFileOptions";
import { WhatsNew } from "ente-new/photos/components/WhatsNew";
import {
GalleryEmptyState,
@@ -121,12 +124,8 @@ import {
SetFilesDownloadProgressAttributes,
SetFilesDownloadProgressAttributesCreator,
} from "types/gallery";
-import {
- getSelectedCollection,
- handleCollectionOp,
- type CollectionOp,
-} from "utils/collection";
-import { getSelectedFiles, handleFileOp, type FileOp } from "utils/file";
+import { getSelectedCollection, handleCollectionOp } from "utils/collection";
+import { getSelectedFiles, handleFileOp } from "utils/file";
/**
* The default view for logged in users.
diff --git a/web/apps/photos/src/utils/collection.ts b/web/apps/photos/src/utils/collection.ts
index 756fcff471..532b4204be 100644
--- a/web/apps/photos/src/utils/collection.ts
+++ b/web/apps/photos/src/utils/collection.ts
@@ -28,8 +28,7 @@ import {
type SetFilesDownloadProgressAttributesCreator,
} from "types/gallery";
import { downloadFilesWithProgress } from "utils/file";
-
-export type CollectionOp = "add" | "move" | "remove" | "restore" | "unhide";
+import { type CollectionOp } from "ente-new/photos/components/SelectedFileOptions";
export async function handleCollectionOp(
op: CollectionOp,
diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts
index cb1a4a03df..48354d8d7f 100644
--- a/web/apps/photos/src/utils/file/index.ts
+++ b/web/apps/photos/src/utils/file/index.ts
@@ -14,6 +14,7 @@ import {
} from "ente-media/file-metadata";
import { FileType } from "ente-media/file-type";
import { decodeLivePhoto } from "ente-media/live-photo";
+import { type FileOp } from "ente-new/photos/components/SelectedFileOptions";
import {
addToFavorites,
deleteFromTrash,
@@ -31,16 +32,6 @@ import {
SetFilesDownloadProgressAttributesCreator,
} from "types/gallery";
-export type FileOp =
- | "download"
- | "fixTime"
- | "favorite"
- | "archive"
- | "unarchive"
- | "hide"
- | "trash"
- | "deletePermanently";
-
function getSelectedFileIds(selectedFiles: SelectedState) {
const filesIDs: number[] = [];
for (const [key, val] of Object.entries(selectedFiles)) {
diff --git a/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx b/web/packages/new/photos/components/SelectedFileOptions.tsx
similarity index 98%
rename from web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx
rename to web/packages/new/photos/components/SelectedFileOptions.tsx
index 1c5e3ca2f5..89ccaf7ba4 100644
--- a/web/apps/photos/src/components/pages/gallery/SelectedFileOptions.tsx
+++ b/web/packages/new/photos/components/SelectedFileOptions.tsx
@@ -22,8 +22,18 @@ import {
type CollectionSummary,
} from "ente-new/photos/services/collection-summary";
import { t } from "i18next";
-import { type CollectionOp } from "utils/collection";
-import { type FileOp } from "utils/file";
+
+export type CollectionOp = "add" | "move" | "remove" | "restore" | "unhide";
+
+export type FileOp =
+ | "download"
+ | "fixTime"
+ | "favorite"
+ | "archive"
+ | "unarchive"
+ | "hide"
+ | "trash"
+ | "deletePermanently";
interface Props {
handleCollectionOp: (op: CollectionOp) => (...args: any[]) => void;