Unified detail views, model
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
import SwiftUI
|
||||
|
||||
struct OptionalStringPropertyView: View {
|
||||
|
||||
let title: LocalizedStringKey
|
||||
|
||||
@Binding
|
||||
var text: String?
|
||||
|
||||
let prompt: String?
|
||||
|
||||
let footer: LocalizedStringKey
|
||||
|
||||
init(title: LocalizedStringKey, text: Binding<String?>, prompt: String? = nil, footer: LocalizedStringKey) {
|
||||
self.title = title
|
||||
self._text = text
|
||||
self.prompt = prompt
|
||||
self.footer = footer
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
GenericPropertyView(title: title, footer: footer) {
|
||||
OptionalTextField(title, text: $text, prompt: prompt)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user