diff --git a/web/apps/photos/src/components/Collections/CollectionListBar/CollectionCard.tsx b/web/apps/photos/src/components/Collections/CollectionListBar/CollectionCard.tsx
index a88534fef4..9cb8de3124 100644
--- a/web/apps/photos/src/components/Collections/CollectionListBar/CollectionCard.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionListBar/CollectionCard.tsx
@@ -3,8 +3,8 @@ import Favorite from "@mui/icons-material/FavoriteRounded";
import LinkIcon from "@mui/icons-material/Link";
import PeopleIcon from "@mui/icons-material/People";
import PushPin from "@mui/icons-material/PushPin";
-import { Box } from "@mui/material";
-import TruncateText from "components/TruncateText";
+import { Box, Typography, styled } from "@mui/material";
+import Tooltip from "@mui/material/Tooltip";
import { CollectionSummaryType } from "constants/collection";
import { CollectionSummary } from "types/collection";
import CollectionCard from "../CollectionCard";
@@ -78,3 +78,24 @@ function CollectionCardIcon({ collectionType }) {
}
export default CollectionListBarCard;
+
+const TruncateText = ({ text }) => {
+ return (
+
+
+
+ {text}
+
+
+
+ );
+};
+
+const Ellipse = styled(Typography)`
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2; //number of lines to show
+ line-clamp: 2;
+ -webkit-box-orient: vertical;
+`;
diff --git a/web/apps/photos/src/components/Notification.tsx b/web/apps/photos/src/components/Notification.tsx
index f1e996b3c8..0ade15c750 100644
--- a/web/apps/photos/src/components/Notification.tsx
+++ b/web/apps/photos/src/components/Notification.tsx
@@ -7,6 +7,7 @@ import {
SxProps,
Theme,
Typography,
+ styled,
type ButtonProps,
} from "@mui/material";
import { NotificationAttributes } from "types/Notification";
@@ -72,6 +73,7 @@ export default function Notification({
spacing={2}
direction="row"
alignItems={"center"}
+ width={"100%"}
>
{attributes.startIcon ?? }
@@ -82,26 +84,29 @@ export default function Notification({
spacing={0.5}
flex={1}
textAlign="left"
+ // This is necessary to trigger the ellipsizing of the
+ // text in children.
+ overflow="hidden"
>
{attributes.subtext && (
-
+
{attributes.subtext}
-
+
)}
{attributes.message && (
-
+
{attributes.message}
-
+
)}
{attributes.title && (
-
+
{attributes.title}
-
+
)}
{attributes.caption && (
-
+
{attributes.caption}
-
+
)}
@@ -122,3 +127,9 @@ export default function Notification({
);
}
+
+const EllipsizedTypography = styled(Typography)`
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+`;
diff --git a/web/apps/photos/src/components/TruncateText.tsx b/web/apps/photos/src/components/TruncateText.tsx
deleted file mode 100644
index 3d34972157..0000000000
--- a/web/apps/photos/src/components/TruncateText.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Box, styled, Typography } from "@mui/material";
-import Tooltip from "@mui/material/Tooltip";
-
-const Ellipse = styled(Typography)`
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2; //number of lines to show
- line-clamp: 2;
- -webkit-box-orient: vertical;
-`;
-
-export default function TruncateText({ text }) {
- return (
-
-
-
- {text}
-
-
-
- );
-}