Skip to content

armgit / ente

Public Imported from GitHub
0

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

Empty state

Manav Rathi2f27ae7b1933
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 3cbf5ef0cd..4723ddd02c 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -3,7 +3,7 @@ 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 { PeopleEmptyState, SearchResultsHeader } from "@/new/photos/components/Gallery";
import type { GalleryBarMode } from "@/new/photos/components/Gallery/BarImpl";
import { GalleryPeopleState } from "@/new/photos/components/Gallery/PeopleHeader";
import {
@@ -1103,12 +1103,6 @@ export default function Gallery() {
return <div></div>;
}
- const showEmptySectionState =
- !isInSearchMode &&
- !isFirstLoad &&
- !files?.length &&
- !hiddenFiles?.length;
-
return (
<GalleryContext.Provider
value={{
@@ -1271,12 +1265,17 @@ export default function Gallery() {
open={openWhatsNew}
onClose={() => setOpenWhatsNew(false)}
/>
- {showEmptySectionState && activeCollectionID === ALL_SECTION ? (
+ {!isInSearchMode &&
+ !isFirstLoad &&
+ !files?.length &&
+ !hiddenFiles?.length &&
+ activeCollectionID === ALL_SECTION ? (
<GalleryEmptyState openUploader={openUploader} />
- ) : showEmptySectionState &&
+ ) : !isInSearchMode &&
+ !isFirstLoad &&
barMode == "people" &&
!galleryPeopleState?.activePerson ? (
- <div>Empty</div>
+ <PeopleEmptyState />
) : (
<PhotoFrame
page={PAGES.GALLERY}
diff --git a/web/packages/new/photos/components/Gallery/index.tsx b/web/packages/new/photos/components/Gallery/index.tsx
index 34325da009..5ac9cda5b9 100644
--- a/web/packages/new/photos/components/Gallery/index.tsx
+++ b/web/packages/new/photos/components/Gallery/index.tsx
@@ -7,7 +7,9 @@
* there.
*/
+import { pt } from "@/base/i18n";
import type { SearchOption } from "@/new/photos/services/search/types";
+import { VerticallyCentered } from "@ente/shared/components/Container";
import { Typography } from "@mui/material";
import { t } from "i18next";
import React from "react";
@@ -40,3 +42,11 @@ export const SearchResultsHeader: React.FC<SearchResultsHeaderProps> = ({
/>
</GalleryItemsHeaderAdapter>
);
+
+export const PeopleEmptyState: React.FC = () => (
+ <VerticallyCentered>
+ <Typography color="text.muted">
+ {pt("People will appear here once indexing completes")}
+ </Typography>
+ </VerticallyCentered>
+);