dms: move timestamp outside of bubble

This commit is contained in:
William Casarin
2023-08-06 14:07:04 -07:00
parent 53e9269da6
commit de58e52199

View File

@@ -41,6 +41,7 @@ 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) let should_show_img = should_show_images(settings: damus_state.settings, contacts: damus_state.contacts, ev: event, our_pubkey: damus_state.pubkey)
VStack(alignment: .trailing) {
NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: .normal, options: dm_options) NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: .normal, options: dm_options)
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
.padding([.top, .leading, .trailing], 10) .padding([.top, .leading, .trailing], 10)
@@ -50,11 +51,12 @@ struct DMView: View {
) )
.cornerRadius(8.0) .cornerRadius(8.0)
.tint(is_ours ? Color.white : Color.accentColor) .tint(is_ours ? Color.white : Color.accentColor)
.overlay(Text(format_relative_time(event.created_at))
Text(format_relative_time(event.created_at))
.font(.footnote) .font(.footnote)
.foregroundColor(.gray) .foregroundColor(.gray)
.opacity(0.8) .opacity(0.8)
.offset(x: -10, y: -5), alignment: .bottomTrailing) }
if !is_ours { if !is_ours {
Spacer(minLength: UIScreen.main.bounds.width * 0.2) Spacer(minLength: UIScreen.main.bounds.width * 0.2)