Skip to content

armgit / ente

Public Imported from GitHub
0

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

[photos][web] Add Links sidebar group header

AswinAsokddc6995bad98
diff --git a/web/apps/photos/src/components/gallery/BarImpl.tsx b/web/apps/photos/src/components/gallery/BarImpl.tsx
index f1c5e0ff56..923c1f2a41 100644
--- a/web/apps/photos/src/components/gallery/BarImpl.tsx
+++ b/web/apps/photos/src/components/gallery/BarImpl.tsx
@@ -121,6 +121,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
const albumListRef = useRef<VariableSizeList | null>(null);
const searchInputRef = useRef<HTMLInputElement>(null);
const [peopleSearchQuery, setPeopleSearchQuery] = useState("");
+ const [linksExpanded, setLinksExpanded] = useState(true);
const searchQuery = mode == "people" ? peopleSearchQuery : albumSearchQuery;
const setSearchQuery =
mode == "people" ? setPeopleSearchQuery : onAlbumSearchQueryChange;
@@ -195,7 +196,7 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
? {
type: "collections",
collectionSummaries: displayedCollectionSummaries,
- indented: mode == "albums",
+ indented: mode == "albums" || mode == "links",
activeCollectionID: activeCollectionID!,
onSelectCollectionID,
}
@@ -687,6 +688,36 @@ export const GalleryBarImpl: React.FC<GalleryBarImplProps> = ({
)}
</AutoSizer>
</Box>
+ ) : mode == "links" ? (
+ <Stack
+ role="group"
+ aria-label={t("links")}
+ sx={{ flex: 1, minHeight: 0, minWidth: 0 }}
+ >
+ <BarCard
+ aria-expanded={isSearching || linksExpanded}
+ onClick={() =>
+ setLinksExpanded((expanded) => !expanded)
+ }
+ sx={{ flexShrink: 0, height: rowHeight }}
+ >
+ <CardText>{t("links")}</CardText>
+ <Box
+ component={HugeiconsIcon}
+ icon={ArrowDown01Icon}
+ size={16}
+ strokeWidth={1.8}
+ sx={{
+ color: "text.muted",
+ transform:
+ isSearching || linksExpanded
+ ? undefined
+ : "rotate(-90deg)",
+ }}
+ />
+ </BarCard>
+ {(isSearching || linksExpanded) && items}
+ </Stack>
) : (
items
)}