Added copy relay action
Closes: #197 Changelog-Added: Added ability to copy relay urls
This commit is contained in:
committed by
William Casarin
parent
3d5a098423
commit
2c15d22d86
@@ -48,12 +48,22 @@ struct RelayView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
|
CopyAction(relay: relay)
|
||||||
|
|
||||||
if let privkey = state.keypair.privkey {
|
if let privkey = state.keypair.privkey {
|
||||||
RemoveAction(privkey: 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 {
|
func RemoveAction(privkey: String) -> some View {
|
||||||
Button {
|
Button {
|
||||||
guard let ev = state.contacts.event else {
|
guard let ev = state.contacts.event else {
|
||||||
@@ -72,11 +82,6 @@ struct RelayView: View {
|
|||||||
}
|
}
|
||||||
.tint(.red)
|
.tint(.red)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fileprivate func remove_action() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RelayView_Previews: PreviewProvider {
|
struct RelayView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user