Skip to content

armgit / ente

Public Imported from GitHub
0

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

[photos][web] Return to People overview from sidebar header

AswinAsok098e296f4303
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index 0db9cee011..fd4ff127e7 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -99,6 +99,7 @@ export const GalleryBarAndListHeader: React.FC<
albumSearchQuery,
onAlbumSearchQueryChange,
onShowAlbumOverview,
+ onShowPeopleOverview,
onSelectPerson,
saveGroups,
hasActiveFileSelection,
@@ -324,6 +325,7 @@ export const GalleryBarAndListHeader: React.FC<
albumSearchQuery,
onAlbumSearchQueryChange,
onShowAlbumOverview,
+ onShowPeopleOverview,
activeCollectionID,
people: sortedPeople,
activePerson,
diff --git a/web/apps/photos/src/components/gallery/BarImpl.tsx b/web/apps/photos/src/components/gallery/BarImpl.tsx
index d18a97c10b..2a0cfd2103 100644
--- a/web/apps/photos/src/components/gallery/BarImpl.tsx
+++ b/web/apps/photos/src/components/gallery/BarImpl.tsx
@@ -72,6 +72,7 @@ export interface GalleryBarImplProps extends GalleryBarPresentationProps {
albumSearchQuery: string;
onAlbumSearchQueryChange: (query: string) => void;
onShowAlbumOverview: (filter: AlbumFilter) => void;
+ onShowPeopleOverview: () => void;
collectionSummaries: CollectionSummary[];
visibleAlbumFilters: typeof albumFilters;
normalCollectionSummaries: CollectionSummaries;
@@ -98,6 +99,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
albumSearchQuery,
onAlbumSearchQueryChange,
onShowAlbumOverview,
+ onShowPeopleOverview,
collectionSummaries,
visibleAlbumFilters,
normalCollectionSummaries,
@@ -357,7 +359,30 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
lineHeight: mobile ? "26px" : "32px",
}}
>
- {title}
+ {mode == "people" ? (
+ <ButtonBase
+ onClick={() => {
+ setPeopleSearchQuery("");
+ onShowPeopleOverview();
+ mobileDrawerProps.onClose();
+ }}
+ sx={{
+ font: "inherit",
+ justifyContent: "flex-start",
+ borderRadius: 1,
+ "&:hover": { color: "text.muted" },
+ "&.Mui-focusVisible": {
+ outline: "2px solid",
+ outlineColor: "primary.main",
+ outlineOffset: 2,
+ },
+ }}
+ >
+ {title}
+ </ButtonBase>
+ ) : (
+ title
+ )}
</Typography>
{mode != "people" ? (
<CollectionsSortOptions
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 9f7c14a265..0b7bb9ae97 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -2112,6 +2112,7 @@ const Page: React.FC = () => {
albumSearchQuery,
onAlbumSearchQueryChange: setAlbumSearchQuery,
onShowAlbumOverview: handleShowAlbumOverview,
+ onShowPeopleOverview: handleShowPeople,
onAlbumSummariesChange:
handleAlbumSummariesChange,
peopleSortBy,