mirror of
git://jb55.com/damus
synced 2024-09-30 17:00:43 +00:00
Added copy relay action
Closes: #197 Changelog-Added: Added ability to copy relay urls
This commit is contained in:
parent
3d5a098423
commit
2c15d22d86
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user