Make sure recently added has a max of two lines

This commit is contained in:
Jackson Harper
2024-06-21 15:07:21 +08:00
parent 59866510b0
commit bc934a4706

View File

@ -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 (
<HStack
className="title-text"
@ -486,7 +492,7 @@ const TitleSmall = (props: HomeItemViewProps): JSX.Element => {
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 => {
</SpanBox>
</HStack>
<TitleSmall homeItem={props.homeItem} />
<TitleSmall homeItem={props.homeItem} maxLines="2" />
</VStack>
)
}