Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web][photos] Keep mobile gallery headers compact

AswinAsokb25530cdf98a
diff --git a/web/apps/photos/src/components/collections/CollectionHeader.tsx b/web/apps/photos/src/components/collections/CollectionHeader.tsx
index 11e10b9e83..0082b4718b 100644
--- a/web/apps/photos/src/components/collections/CollectionHeader.tsx
+++ b/web/apps/photos/src/components/collections/CollectionHeader.tsx
@@ -139,7 +139,18 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {
return (
<GalleryItemsHeaderAdapter ref={headerRef}>
<SpacedRow
- sx={{ gap: 2, alignItems: isAlbum ? "flex-start" : "center" }}
+ sx={
+ isAlbum
+ ? {
+ display: "grid",
+ gridTemplateColumns: "minmax(0, 1fr) auto",
+ gridTemplateAreas:
+ '"summary actions" "description description"',
+ columnGap: 2,
+ alignItems: "start",
+ }
+ : { gap: 2, alignItems: "center" }
+ }
>
<Stack
direction="row"
@@ -147,6 +158,7 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {
gap: isAlbum ? 2 : 1,
alignItems: "center",
minWidth: 0,
+ ...(isAlbum && { gridArea: "summary" }),
}}
>
{(type == "hiddenItems" || type == "archiveItems") && (
@@ -182,15 +194,22 @@ export const CollectionHeader: React.FC<CollectionHeaderProps> = (props) => {
/>
</Stack>
{shouldShowOptions(type) && (
- <CollectionHeaderOptions {...props} />
+ <Box sx={isAlbum ? { gridArea: "actions" } : undefined}>
+ <CollectionHeaderOptions {...props} />
+ </Box>
+ )}
+ {isAlbum && (
+ <AlbumDescription
+ description={description}
+ sx={{
+ gridArea: "description",
+ pt: 1,
+ maxWidth: 480,
+ color: "text.faint",
+ }}
+ />
)}
</SpacedRow>
- {isAlbum && (
- <AlbumDescription
- description={description}
- sx={{ pt: 1, maxWidth: 480, color: "text.faint" }}
- />
- )}
</GalleryItemsHeaderAdapter>
);
};
@@ -725,7 +744,9 @@ const CollectionHeaderOptions: React.FC<CollectionHeaderProps> = ({
display: "inline-flex",
gap: "16px",
flexShrink: 0,
- mt: isAlbumSummary(collectionSummary) ? "3px" : 0,
+ mt: isAlbumSummary(collectionSummary)
+ ? { xs: 0, sm: "3px" }
+ : 0,
}}
>
<QuickOptions
diff --git a/web/packages/new/photos/components/gallery/ListHeader.tsx b/web/packages/new/photos/components/gallery/ListHeader.tsx
index 0248988955..805ee00f6b 100644
--- a/web/packages/new/photos/components/gallery/ListHeader.tsx
+++ b/web/packages/new/photos/components/gallery/ListHeader.tsx
@@ -168,7 +168,9 @@ export const GalleryItemsHeaderAdapter = styled("div")`
`;
/** A compact cover shared by album and person gallery headers. */
-export const GalleryItemsCoverTile = styled("div")({
+export const GalleryItemsCoverTile = styled("div")(({ theme }) => ({
+ display: "none",
+ [theme.breakpoints.up("sm")]: { display: "block" },
width: 54,
height: 54,
flexShrink: 0,
@@ -177,4 +179,4 @@ export const GalleryItemsCoverTile = styled("div")({
position: "relative",
alignSelf: "flex-start",
"& > img": { width: "100%", height: "100%", objectFit: "cover" },
-});
+}));