From ebc40d1b650b9ed901c179c481e0a3d6cb4c7864 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 20 Sep 2024 18:11:08 +0530 Subject: [PATCH] checkpoint --- .../Collections/CollectionListBar.tsx | 23 +++++++++++++++---- .../src/components/Collections/index.tsx | 4 ++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/web/apps/photos/src/components/Collections/CollectionListBar.tsx b/web/apps/photos/src/components/Collections/CollectionListBar.tsx index 7a7a012d13..90b997987b 100644 --- a/web/apps/photos/src/components/Collections/CollectionListBar.tsx +++ b/web/apps/photos/src/components/Collections/CollectionListBar.tsx @@ -12,7 +12,7 @@ import LinkIcon from "@mui/icons-material/Link"; import NavigateNextIcon from "@mui/icons-material/NavigateNext"; import PeopleIcon from "@mui/icons-material/People"; import PushPin from "@mui/icons-material/PushPin"; -import { Box, IconButton, Typography, styled } from "@mui/material"; +import { Box, IconButton, Stack, Typography, styled } from "@mui/material"; import Tooltip from "@mui/material/Tooltip"; import { CollectionTile } from "components/Collections/styledComponents"; import { @@ -42,6 +42,14 @@ interface CollectionListBarProps { * Called when the user changes the active collection. */ setActiveCollectionID: (id?: number) => void; + /** + * The ID of the currently selected person (if any). + */ + activePersonID: string | undefined; + /** + * Called when the user changes the active person. + */ + setActivePersonID: (id: string | undefined) => void; /** * Called when the user selects the option to show a modal with all the * collections. @@ -66,6 +74,8 @@ export const CollectionListBar: React.FC = ({ isInHiddenSection, activeCollectionID, setActiveCollectionID, + activePersonID, + // setActivePersonID onShowAllCollections, collectionListSortBy, setCollectionListSortBy, @@ -145,12 +155,17 @@ export const CollectionListBar: React.FC = ({ onCollectionClick, ); + const mode = activePersonID ? "people" : "albums"; + return ( - - {isInHiddenSection ? t("HIDDEN_ALBUMS") : t("ALBUMS")} - + + + {isInHiddenSection ? t("HIDDEN_ALBUMS") : t("ALBUMS")} + + {mode == "people" && {t("people")}} + {isMobile && ( console.log(id)} onShowAllCollections={openAllCollections} collectionListSortBy={collectionListSortBy} setCollectionListSortBy={setCollectionListSortBy}