timeline: fix scrollbar issues on URL previews

* Prevents rendering an empty url-previews div
* Sets overflow-x to "auto" instead of "scroll"

Signed-off-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
Sumner Evans 2025-02-24 22:08:28 -07:00
parent 5d41b49462
commit c101dbaab1
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@ div.url-previews {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 1rem; gap: 1rem;
overflow-x: scroll; overflow-x: auto;
> div.url-preview { > div.url-preview {
margin: 0.5rem 0; margin: 0.5rem 0;

View file

@ -33,7 +33,7 @@ const URLPreviews = ({ event, room }: {
} }
const previews = (event.content["com.beeper.linkpreviews"] ?? event.content["m.url_previews"]) as URLPreview[] const previews = (event.content["com.beeper.linkpreviews"] ?? event.content["m.url_previews"]) as URLPreview[]
if (!previews) { if (!previews || !previews.length) {
return null return null
} }
return <div className="url-previews"> return <div className="url-previews">