damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 98685645d307a23bf6fb8e59d33bf2a63c113cc3
parent 14f71f1a1d75e95d103090f46b30f2d43aaff638
Author: Joel Klabo <joelklabo@gmail.com>
Date:   Sat, 18 Mar 2023 20:36:50 -0700

Add Time Ago to DM View

Changelog-Added: Add Time Ago to DM View
Closes: #790

Diffstat:
Mdamus/Views/DMView.swift | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/damus/Views/DMView.swift b/damus/Views/DMView.swift @@ -24,12 +24,18 @@ struct DMView: View { let should_show_img = should_show_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey) NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: .normal, artifacts: .just_content(event.get_content(damus_state.keypair.privkey)), truncate: false) - .padding(10) + .padding([.top, .leading, .trailing], 10) + .padding([.bottom], 25) .background(VisualEffectView(effect: UIBlurEffect(style: .prominent)) .background(is_ours ? Color.accentColor.opacity(0.9) : Color.secondary.opacity(0.15)) ) .cornerRadius(8.0) .tint(is_ours ? Color.white : Color.accentColor) + .overlay(Text(format_relative_time(event.created_at)) + .font(.footnote) + .foregroundColor(.white) + .opacity(0.8) + .offset(x: -10, y: -5), alignment: .bottomTrailing) if !is_ours { Spacer(minLength: UIScreen.main.bounds.width * 0.2) }