commit 2c15d22d86c8a66394c67eebe7b480c7f0ff7b7e
parent 3d5a098423802a9e9d4f934d71ac2398e4ed3e65
Author: Matt Ward <matthew@coincorner.com>
Date: Sat, 31 Dec 2022 20:11:32 +0000
Added copy relay action
Closes: #197
Changelog-Added: Added ability to copy relay urls
Diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/damus/Views/RelayView.swift b/damus/Views/RelayView.swift
@@ -48,12 +48,22 @@ struct RelayView: View {
}
}
.contextMenu {
+ CopyAction(relay: relay)
+
if let privkey = state.keypair.privkey {
RemoveAction(privkey: privkey)
}
}
}
+ func CopyAction(relay: String) -> some View {
+ Button {
+ UIPasteboard.general.setValue(relay, forPasteboardType: "public.plain-text")
+ } label: {
+ Label("Copy", systemImage: "doc.on.doc")
+ }
+ }
+
func RemoveAction(privkey: String) -> some View {
Button {
guard let ev = state.contacts.event else {
@@ -72,11 +82,6 @@ struct RelayView: View {
}
.tint(.red)
}
-
-}
-
-fileprivate func remove_action() {
-
}
struct RelayView_Previews: PreviewProvider {