web/timeline: allow opening lightbox from url preview image

This commit is contained in:
Tulir Asokan 2024-12-22 02:03:51 +02:00
parent 6830e5d1cc
commit 588a994b55

View file

@ -19,6 +19,7 @@ import { RoomStateStore, usePreference } from "@/api/statestore"
import { MemDBEvent, URLPreview } from "@/api/types" import { MemDBEvent, URLPreview } from "@/api/types"
import { ImageContainerSize, calculateMediaSize } from "@/util/mediasize" import { ImageContainerSize, calculateMediaSize } from "@/util/mediasize"
import ClientContext from "../ClientContext" import ClientContext from "../ClientContext"
import { LightboxContext } from "../modal/Lightbox.tsx"
import "./URLPreviews.css" import "./URLPreviews.css"
const URLPreviews = ({ event, room }: { const URLPreviews = ({ event, room }: {
@ -58,6 +59,7 @@ const URLPreviews = ({ event, room }: {
loading="lazy" loading="lazy"
style={style.media} style={style.media}
src={mediaURL} src={mediaURL}
onClick={use(LightboxContext)!}
alt="" alt=""
/> />
</div> </div>