Browse Source

Added copy relay action

Closes: #197
Changelog-Added: Added ability to copy relay urls
post-button-style
Matt Ward 2 years ago
committed by William Casarin
parent
commit
2c15d22d86
  1. 15
      damus/Views/RelayView.swift

15
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 {

Loading…
Cancel
Save