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

View File

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