From 6f0a36acde9c5e31878ac6ed69fc3c2ca6c2e7ed Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 28 Jun 2024 22:13:13 +0530 Subject: [PATCH] Inline --- .../CollectionListBar/CollectionCard.tsx | 25 +++++++++++++++++-- .../photos/src/components/TruncateText.tsx | 23 ----------------- 2 files changed, 23 insertions(+), 25 deletions(-) delete mode 100644 web/apps/photos/src/components/TruncateText.tsx 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/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} - - - - ); -}