From bc934a4706ca2f80ca3e1fb271bb264fedf630b3 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 21 Jun 2024 15:07:21 +0800 Subject: [PATCH] Make sure recently added has a max of two lines --- .../web/components/nav-containers/HomeContainer.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/web/components/nav-containers/HomeContainer.tsx b/packages/web/components/nav-containers/HomeContainer.tsx index 59ff4e84a..0c1da5be9 100644 --- a/packages/web/components/nav-containers/HomeContainer.tsx +++ b/packages/web/components/nav-containers/HomeContainer.tsx @@ -469,7 +469,13 @@ const Title = (props: HomeItemViewProps): JSX.Element => { ) } -const TitleSmall = (props: HomeItemViewProps): JSX.Element => { +type TitleSmallProps = { + maxLines?: string +} + +const TitleSmall = ( + props: HomeItemViewProps & TitleSmallProps +): JSX.Element => { return ( { textOverflow: 'ellipsis', wordBreak: 'break-word', display: '-webkit-box', - '-webkit-line-clamp': '3', + '-webkit-line-clamp': props.maxLines ?? '3', '-webkit-box-orient': 'vertical', }} > @@ -565,7 +571,7 @@ const JustAddedItemView = (props: HomeItemViewProps): JSX.Element => { - + ) }