fix: collection name not displayed correctly when too large.

This commit is contained in:
Sonny
2024-11-15 14:23:39 +01:00
parent e8aca90870
commit 1938f6ea23
3 changed files with 16 additions and 5 deletions

View File

@@ -33,14 +33,19 @@ export default function CollectionItem({
href={appendCollectionId(route('dashboard').path, collection.id)}
key={collection.id}
ref={itemRef}
title={collection.name}
>
<FolderIcon className={classes.linkIcon} />
<Text lineClamp={1} maw={showLinks ? '160px' : '200px'}>
<Text lineClamp={1} maw={'200px'} style={{ wordBreak: 'break-all' }}>
{collection.name}
</Text>
{showLinks && (
<Text c="var(--mantine-color-gray-5)" ml="xs">
{linksCount}
<Text
style={{ whiteSpace: 'nowrap' }}
c="var(--mantine-color-gray-5)"
ml={4}
>
{linksCount}0
</Text>
)}
</Link>

View File

@@ -43,7 +43,7 @@ export function DashboardHeader({ navbar, aside }: DashboardHeaderProps) {
hiddenFrom="sm"
size="sm"
/>
<Box w="50%">
<Box>
<Text lineClamp={1}>
{activeCollection?.name}{' '}
{activeCollection?.visibility === Visibility.PUBLIC && (

View File

@@ -14,7 +14,13 @@ export const FavoriteItem = ({ link }: { link: LinkWithCollection }) => (
<Text lineClamp={1} c="blue">
{link.name}
</Text>
<Text c="gray" size="xs" mb={4} lineClamp={1}>
<Text
c="gray"
size="xs"
mb={4}
lineClamp={1}
style={{ wordBreak: 'break-all' }}
>
{link.collection.name}
</Text>
</Flex>