Show referenced notes in DMs
Changelog-Added: Show referenced notes in DMs
This commit is contained in:
@@ -14,8 +14,18 @@ struct DMView: View {
|
|||||||
var is_ours: Bool {
|
var is_ours: Bool {
|
||||||
event.pubkey == damus_state.pubkey
|
event.pubkey == damus_state.pubkey
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var Mention: some View {
|
||||||
|
Group {
|
||||||
|
if let mention = first_eref_mention(ev: event, privkey: damus_state.keypair.privkey) {
|
||||||
|
BuilderEventView(damus: damus_state, event_id: mention.ref.id)
|
||||||
|
} else {
|
||||||
|
EmptyView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var DM: some View {
|
||||||
HStack {
|
HStack {
|
||||||
if is_ours {
|
if is_ours {
|
||||||
Spacer(minLength: UIScreen.main.bounds.width * 0.2)
|
Spacer(minLength: UIScreen.main.bounds.width * 0.2)
|
||||||
@@ -36,11 +46,20 @@ struct DMView: View {
|
|||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
.opacity(0.8)
|
.opacity(0.8)
|
||||||
.offset(x: -10, y: -5), alignment: .bottomTrailing)
|
.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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack {
|
||||||
|
Mention
|
||||||
|
DM
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DMView_Previews: PreviewProvider {
|
struct DMView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user