Browse Source

Added paste and delete buttons to add relay field

Closes: #168
Changelog-Added: Added paste and delete buttons to add relay field
post-button-style
Suhail Saqan 2 years ago
committed by William Casarin
parent
commit
c4acebdfee
  1. 28
      damus/Views/AddRelayView.swift

28
damus/Views/AddRelayView.swift

@ -17,9 +17,31 @@ struct AddRelayView: View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Form { Form {
Section("Add Relay") { Section("Add Relay") {
TextField("wss://some.relay.com", text: $relay) ZStack(alignment: .leading) {
.autocorrectionDisabled(true) HStack{
.textInputAutocapitalization(.never) TextField("wss://some.relay.com", text: $relay)
.padding(2)
.padding(.leading, 25)
.autocorrectionDisabled(true)
.textInputAutocapitalization(.never)
Label("", systemImage: "xmark.circle.fill")
.foregroundColor(.blue)
.padding(.trailing, -25.0)
.opacity((relay == "") ? 0.0 : 1.0)
.onTapGesture {
self.relay = ""
}
}
Label("", systemImage: "doc.on.clipboard")
.padding(.leading, -10)
.onTapGesture {
if let pastedrelay = UIPasteboard.general.string {
self.relay = pastedrelay
}
}
}
} }
} }

Loading…
Cancel
Save