Skip to content

armgit / ente

Public Imported from GitHub
0

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

Refine Space caption layout

Anand Baburajan5aaa2cec6893
diff --git a/web/apps/space/src/components/SpaceFileViewer.tsx b/web/apps/space/src/components/SpaceFileViewer.tsx
index 3759680561..988b43efca 100644
--- a/web/apps/space/src/components/SpaceFileViewer.tsx
+++ b/web/apps/space/src/components/SpaceFileViewer.tsx
@@ -309,6 +309,7 @@ const viewerCaptionTextSx = {
fontWeight: 650,
lineHeight: "21px",
textAlign: "center",
+ textWrap: "balance",
whiteSpace: "pre-wrap",
} as const;
const viewerCaptionBubbleSx = {
diff --git a/web/apps/space/src/screens/HomeScreen.tsx b/web/apps/space/src/screens/HomeScreen.tsx
index d96843bbc1..c238f28e08 100644
--- a/web/apps/space/src/screens/HomeScreen.tsx
+++ b/web/apps/space/src/screens/HomeScreen.tsx
@@ -87,6 +87,7 @@ const feedPhotoCaptionTextSx = {
fontWeight: 650,
lineHeight: "19px",
textAlign: "center",
+ textWrap: "balance",
} as const;
const feedPhotoCaptionBubbleSx = {
bgcolor: "rgba(48, 48, 48, 0.86)",
@@ -637,7 +638,7 @@ const FeedPhotoCaption: React.FC<{ caption: string }> = ({ caption }) => {
const measure = () => {
const fits = (value: string) => {
text.textContent = value;
- return text.getClientRects().length <= 3;
+ return text.getClientRects().length <= 2;
};
if (fits(caption)) {
setDisplayCaption(caption);
@@ -694,7 +695,7 @@ const FeedPhotoCaption: React.FC<{ caption: string }> = ({ caption }) => {
title={caption}
sx={{
...feedPhotoCaptionTextSx,
- bottom: 28,
+ bottom: 20,
display: "-webkit-box",
left: "50%",
maxWidth: "70%",
@@ -703,7 +704,7 @@ const FeedPhotoCaption: React.FC<{ caption: string }> = ({ caption }) => {
textShadow: "0 1px 10px rgba(0, 0, 0, 0.74)",
transform: "translateX(-50%)",
WebkitBoxOrient: "vertical",
- WebkitLineClamp: 3,
+ WebkitLineClamp: 2,
width: "max-content",
zIndex: 2,
}}