Skip to content

armgit / ente

Public Imported from GitHub
0

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

temp move

Manav Rathibe7bb8e4b67c
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index c26c6a3827..4053c45939 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -3,11 +3,8 @@ import { NavbarBase } from "@/base/components/Navbar";
import { useIsMobileWidth } from "@/base/hooks";
import log from "@/base/log";
import type { Collection } from "@/media/collection";
+import { SearchResultsHeader } from "@/new/photos/components/Gallery";
import type { GalleryBarMode } from "@/new/photos/components/Gallery/BarImpl";
-import {
- GalleryItemsHeaderAdapter,
- GalleryItemsSummary,
-} from "@/new/photos/components/Gallery/ListHeader";
import {
SearchBar,
type SearchBarProps,
@@ -1380,21 +1377,3 @@ const HiddenSectionNavbarContents: React.FC<
</FlexWrapper>
</HorizontalFlex>
);
-
-interface SearchResultsHeaderProps {
- selectedOption: SearchOption;
-}
-
-const SearchResultsHeader: React.FC<SearchResultsHeaderProps> = ({
- selectedOption,
-}) => (
- <GalleryItemsHeaderAdapter>
- <Typography color="text.muted" variant="large">
- {t("search_results")}
- </Typography>
- <GalleryItemsSummary
- name={selectedOption.suggestion.label}
- fileCount={selectedOption.fileCount}
- />
- </GalleryItemsHeaderAdapter>
-);
diff --git a/web/packages/new/photos/components/Gallery/index.tsx b/web/packages/new/photos/components/Gallery/index.tsx
new file mode 100644
index 0000000000..928f1c3da0
--- /dev/null
+++ b/web/packages/new/photos/components/Gallery/index.tsx
@@ -0,0 +1,30 @@
+/**
+ * @file code that really belongs to pages/gallery.tsx itself, but written here
+ * in a separate file so that we can write in this package that has TypeScript
+ * strict mode enabled. Once the original gallery.tsx is strict mode, this code
+ * can be inlined back there.
+ */
+
+import type { SearchOption } from "@/new/photos/services/search/types";
+import { Typography } from "@mui/material";
+import { t } from "i18next";
+import React from "react";
+import { GalleryItemsHeaderAdapter, GalleryItemsSummary } from "./ListHeader";
+
+interface SearchResultsHeaderProps {
+ selectedOption: SearchOption;
+}
+
+export const SearchResultsHeader: React.FC<SearchResultsHeaderProps> = ({
+ selectedOption,
+}) => (
+ <GalleryItemsHeaderAdapter>
+ <Typography color="text.muted" variant="large">
+ {t("search_results")}
+ </Typography>
+ <GalleryItemsSummary
+ name={selectedOption.suggestion.label}
+ fileCount={selectedOption.fileCount}
+ />
+ </GalleryItemsHeaderAdapter>
+);