Truncate long photo set text
This commit is contained in:
parent
cd8e65ab22
commit
ea41ef42a4
@ -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">
|
||||||
|
|||||||
@ -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>}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user