Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(photos):wrap-subtext-and-handle-zero-storage

Aswin Asokde0f6853bf72
diff --git a/web/apps/photos/src/components/sidebar/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsx
index a3d88f7303..f7cca226fa 100644
--- a/web/apps/photos/src/components/sidebar/Sidebar.tsx
+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx
@@ -960,12 +960,23 @@ const Account: React.FC<AccountProps> = ({
const [sessionCount, setSessionCount] = useState<number>();
const accountLabel = (label: string, subtext?: string) => (
- <Stack sx={{ gap: 0.5, alignItems: "flex-start", textAlign: "left" }}>
+ <Stack
+ sx={{
+ gap: 0.5,
+ minWidth: 0,
+ alignItems: "flex-start",
+ textAlign: "left",
+ }}
+ >
<Typography sx={{ fontWeight: "medium" }}>{label}</Typography>
{subtext && (
<Typography
variant="small"
- sx={{ color: "text.muted", fontWeight: 400 }}
+ sx={{
+ color: "text.muted",
+ fontWeight: 400,
+ overflowWrap: "anywhere",
+ }}
>
{subtext}
</Typography>
diff --git a/web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx b/web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx
index fc48edb84a..077d4c8857 100644
--- a/web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx
+++ b/web/apps/photos/src/components/sidebar/account/SubscriptionCard.tsx
@@ -109,7 +109,7 @@ const SubscriptionCardContentOverlay: React.FC<
}}
>
{inFamily ? (
- storageLimit ? (
+ storageLimit !== undefined ? (
<UserSubscriptionCardContents
userDetails={userDetails}
totalStorage={storageLimit}
@@ -228,7 +228,7 @@ const UsageBarSegment: React.FC<UsageBarSegmentProps> = ({
}}
style={
{
- "--et-width": `${Math.min(usage / storage, 1) * 100}%`,
+ "--et-width": `${storage > 0 ? Math.min(usage / storage, 1) * 100 : 0}%`,
"--et-background-color": fillColor,
} as React.CSSProperties
}