Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move

Manav Rathi6140f35e69ca
diff --git a/web/packages/gallery/components/viewer/icons.tsx b/web/packages/gallery/components/viewer/icons.tsx
new file mode 100644
index 0000000000..1238f7f619
--- /dev/null
+++ b/web/packages/gallery/components/viewer/icons.tsx
@@ -0,0 +1,19 @@
+/**
+ * @file [Note: SVG paths of MUI icons]
+ *
+ * When creating buttons for use with PhotoSwipe, we need to provide just the
+ * contents of the SVG element (e.g. paths) as an HTML string.
+ *
+ * Since we only need a handful, these strings were created by temporarily
+ * adding the following code in some existing React component to render the
+ * corresponding MUI icon React component to a string, and retain the path.
+ *
+ * 1. import { renderToString } from "react-dom/server";
+ *
+ * 2. console.log(renderToString(<InfoOutlinedIcon />));
+ */
+
+// const html =
+// console.log(renderToString(<InfoOutlinedIcon />));
+// const path =
+// '<path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"></path>';
diff --git a/web/packages/gallery/components/viewer/photoswipe.ts b/web/packages/gallery/components/viewer/photoswipe.ts
index f112e712de..9f2b73d84b 100644
--- a/web/packages/gallery/components/viewer/photoswipe.ts
+++ b/web/packages/gallery/components/viewer/photoswipe.ts
@@ -11,8 +11,6 @@ import type { EnteFile } from "@/media/file";
import { FileType } from "@/media/file-type";
import type { FileViewerProps } from "./FileViewer";
-// import { renderToString } from "react-dom/server";
-
// TODO(PS): WIP gallery using upstream photoswipe
//
// Needs (not committed yet):
@@ -326,10 +324,6 @@ export class FileViewerPhotoSwipe {
// - zoom: 10
// - close: 20
pswp.on("uiRegister", () => {
- // const html = <InfoOutlinedIcon fontSize="32" />;
- // console.log(renderToString(html));
- // const path =
- // '<path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"></path>';
const pathWithIDAndTransform =
'<path d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8" transform="translate(3.5, 3.5)" id="pswp__icn-info" />';
pswp.ui.registerElement({