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,20 +41,22 @@ 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)
NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: .normal, options: dm_options) VStack(alignment: .trailing) {
.fixedSize(horizontal: false, vertical: true) NoteContentView(damus_state: damus_state, event: event, show_images: should_show_img, size: .normal, options: dm_options)
.padding([.top, .leading, .trailing], 10) .fixedSize(horizontal: false, vertical: true)
.padding([.bottom], 25) .padding([.top, .leading, .trailing], 10)
.background(VisualEffectView(effect: UIBlurEffect(style: .prominent)) .padding([.bottom], 25)
.background(is_ours ? Color.accentColor.opacity(0.9) : Color.secondary.opacity(0.15)) .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) .cornerRadius(8.0)
.overlay(Text(format_relative_time(event.created_at)) .tint(is_ours ? Color.white : Color.accentColor)
.font(.footnote)
.foregroundColor(.gray) Text(format_relative_time(event.created_at))
.opacity(0.8) .font(.footnote)
.offset(x: -10, y: -5), alignment: .bottomTrailing) .foregroundColor(.gray)
.opacity(0.8)
}
if !is_ours { if !is_ours {
Spacer(minLength: UIScreen.main.bounds.width * 0.2) Spacer(minLength: UIScreen.main.bounds.width * 0.2)