From 2b0a7d126d500ea731f0528ddecec1d635a4e600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Sat, 13 Jul 2024 00:31:37 +0000 Subject: [PATCH] Add missing mention view from chat event bubble view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- damus/Views/Chat/ChatEventView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/damus/Views/Chat/ChatEventView.swift b/damus/Views/Chat/ChatEventView.swift index 0251b0f5..1bdc9b9e 100644 --- a/damus/Views/Chat/ChatEventView.swift +++ b/damus/Views/Chat/ChatEventView.swift @@ -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)