Add missing mention view from chat event bubble view

This commit adds event mentions to the chat bubbles.

Testing
-------

PASS

Damus: This commit
Device: iPhone 15 simulator
iOS: 17.5
Coverage:
- Tested referencing an event on a thread reply. Thread reply shows up as expected
- Checked appearance on light and dark mode
- Tapping on the mentioned event takes the user to that event

Closes: https://github.com/damus-io/damus/issues/2309
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
Daniel D’Aquino
2024-07-13 00:31:37 +00:00
committed by William Casarin
parent 6e2c133faa
commit 2b0a7d126d

View File

@@ -126,6 +126,11 @@ struct ChatEventView: View {
let blur_images = should_blur_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey)
NoteContentView(damus_state: damus_state, event: event, blur_images: blur_images, size: .normal, options: [.truncate_content])
.padding(2)
if let mention = first_eref_mention(ev: event, keypair: damus_state.keypair) {
MentionView(damus_state: damus_state, mention: mention)
.background(DamusColors.adaptableWhite)
.clipShape(RoundedRectangle(cornerSize: CGSize(width: 10, height: 10)))
}
}
.frame(minWidth: 5, alignment: is_ours ? .trailing : .leading)
.padding(10)