From c9463804a8ef361b1d33ef2687ba1c5b09ff3a0a Mon Sep 17 00:00:00 2001 From: Jonathan Milligan Date: Sat, 7 Jan 2023 19:42:19 -0600 Subject: [PATCH] style: DMs only take up 80% of screen width DMs now take up only 80% of the available screen width so it looks much more like iMessages. Closes: #286 Changelog-Changed: Make DMs only take up 80% of screen width --- damus/Views/DMView.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/damus/Views/DMView.swift b/damus/Views/DMView.swift index ffc2191..f757ca3 100644 --- a/damus/Views/DMView.swift +++ b/damus/Views/DMView.swift @@ -10,25 +10,28 @@ import SwiftUI struct DMView: View { let event: NostrEvent let damus_state: DamusState - + var is_ours: Bool { event.pubkey == damus_state.pubkey } - + var body: some View { HStack { if is_ours { - Spacer() + Spacer(minLength: UIScreen.main.bounds.width * 0.2) } - + let should_show_img = should_show_images(contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey) - + NoteContentView(privkey: damus_state.keypair.privkey, event: event, profiles: damus_state.profiles, previews: damus_state.previews, show_images: should_show_img, artifacts: .just_content(event.get_content(damus_state.keypair.privkey)), size: .normal) .foregroundColor(is_ours ? Color.white : Color.primary) .padding(10) .background(is_ours ? Color.accentColor : Color.secondary.opacity(0.15)) .cornerRadius(8.0) .tint(is_ours ? Color.white : Color.accentColor) + if !is_ours { + Spacer(minLength: UIScreen.main.bounds.width * 0.2) + } } } }