replying works

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-04-17 08:49:02 -07:00
parent b4660bd58f
commit 700a0e2625
5 changed files with 53 additions and 3 deletions

View File

@@ -15,12 +15,14 @@ extension Notification.Name {
struct NostrPost {
let content: String
let references: [String]
}
struct PostView: View {
@State var post: String = ""
@FocusState var focus: Bool
let references: [String]
@Environment(\.presentationMode) var presmode
@@ -33,7 +35,7 @@ struct PostView: View {
}
func send_post() {
let new_post = NostrPost(content: self.post)
let new_post = NostrPost(content: self.post, references: references)
NotificationCenter.default.post(name: .post, object: new_post)
dismiss()
}

View File

@@ -0,0 +1,34 @@
//
// ReplyView.swift
// damus
//
// Created by William Casarin on 2022-04-17.
//
import SwiftUI
struct ReplyView: View {
let replying_to: NostrEvent
var body: some View {
VStack {
Text("Replying to:")
EventView(event: replying_to, highlight: .none, has_action_bar: false)
PostView(references: replying_to.reply_ids())
Spacer()
}
.padding()
}
}
/*
struct ReplyView_Previews: PreviewProvider {
static var previews: some View {
ReplyView()
}
}
*/