mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 13:10:29 +00:00
fix(collections): keep a place's name readable next to long labels
A place row was a three-column grid whose last column held the labels, the category and the status, none of which could shrink. With two or three long labels the name got what was left, often one letter or nothing, and the status pill ran out of the card. The row now wraps: the name keeps at least 11rem, and when the labels, category and status do not fit beside it they go to a line of their own under it and wrap there. A label or category too long for its chip ends in an ellipsis instead of being cut mid-letter. Kept tours use the same row and get the same layout. Closes #2981
This commit is contained in:
@@ -70,7 +70,7 @@ export default function CollectionList({
|
||||
<div className="col-lrow-end">
|
||||
{placeLabels.slice(0, 2).map(l => (
|
||||
<span key={l.id} className="col-lrow-label" style={{ ['--label' as string]: l.color || 'var(--accent)' }} title={l.name}>
|
||||
<span className="col-labelchip-dot" /> {l.name}
|
||||
<span className="col-labelchip-dot" /> <span className="col-lrow-txt">{l.name}</span>
|
||||
</span>
|
||||
))}
|
||||
{placeLabels.length > 2 && <span className="col-lrow-label more" title={placeLabels.map(l => l.name).join(', ')}>+{placeLabels.length - 2}</span>}
|
||||
@@ -79,7 +79,7 @@ export default function CollectionList({
|
||||
return (
|
||||
<>
|
||||
<span className="col-lrow-cat" style={{ ['--cat' as string]: place.category.color || '#6366f1' }}>
|
||||
<CatIcon size={11} /> {place.category.name}
|
||||
<CatIcon size={11} /> <span className="col-lrow-txt">{place.category.name}</span>
|
||||
</span>
|
||||
<span className="col-lrow-div" aria-hidden />
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user