Truncate long photo set text

This commit is contained in:
Sam Becker 2025-02-04 18:11:38 -06:00
parent cd8e65ab22
commit ea41ef42a4
2 changed files with 9 additions and 3 deletions

View File

@ -22,6 +22,7 @@ export default function EntityLink({
prefetch,
title,
hoverEntity,
truncate = true,
className,
debug,
}: {
@ -33,8 +34,9 @@ export default function EntityLink({
prefetch?: boolean
title?: string
hoverEntity?: ReactNode
debug?: boolean
truncate?: boolean
className?: string
debug?: boolean
} & EntityLinkExternalProps) {
const classForContrast = () => {
switch (contrast) {
@ -84,7 +86,11 @@ export default function EntityLink({
>
{renderLabel()}
</Badge>
: renderLabel()}
: <span className={clsx(
truncate && 'inline-flex max-w-full [&>*]:truncate',
)}>
{renderLabel()}
</span>}
</LabeledIcon>
{hoverEntity !== undefined &&
<span className="hidden group-hover:inline">

View File

@ -120,7 +120,7 @@ export default function PhotoHeader({
// Necessary for title truncation
: <h1 className={clsx(
'w-full truncate',
headerType !== 'photo-detail' && 'sm:pr-2',
headerType !== 'photo-detail' && 'pr-1 sm:pr-2',
)}>
{renderContentA()}
</h1>}