Fix breaking on author styles

This commit is contained in:
Jackson Harper
2023-08-04 17:29:15 +08:00
parent 5ba2343cc6
commit c7bc590ae8
3 changed files with 7 additions and 8 deletions

View File

@ -70,14 +70,16 @@ export const DescriptionStyle = {
export const AuthorInfoStyle = {
maxLines: '1',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
maxWidth: '240px',
color: '$thNotebookSubtle',
fontSize: '12px',
fontWeight: '400',
fontFamily: '$display',
lineHeight: '1',
wordWrap: 'break-word',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}
export const timeAgo = (date: string | undefined): string => {

View File

@ -249,7 +249,7 @@ const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
>
{props.item.author}
{props.item.author && originText && ' | '}
<SpanBox css={{ textDecoration: 'underline' }}>{originText}</SpanBox>
{originText}
</SpanBox>
<HStack

View File

@ -279,19 +279,16 @@ export function LibraryListCardContent(
<LibraryItemMetadata item={props.item} showProgress={true} />
</HStack>
<Box css={{ ...TitleStyle, width: '80%' }}>{props.item.title}</Box>
<Box css={{ ...TitleStyle }}>{props.item.title}</Box>
{(props.item.author?.length ?? 0 + originText.length) > 0 && (
<SpanBox
css={{
...AuthorInfoStyle,
maxWidth: '90%',
}}
>
{props.item.author}
{props.item.author && originText && ' | '}
<SpanBox css={{ textDecoration: 'underline' }}>
{originText}
</SpanBox>
{originText}
</SpanBox>
)}