42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
import BusX
|
|
import CordX
|
|
import SwiftUI
|
|
|
|
extension MeetupId {
|
|
public struct V: View {
|
|
@StateObject var fmt = MeetupId.Formatter(K.textUI, K.textApp)
|
|
@StateObject var isJA = Cord.Receive(K.isJoinAvailable, false)
|
|
@StateObject var join = Cord.Button(K.join)
|
|
@StateObject var txtF = Cord.TextField(K.textApp, K.textUI)
|
|
let joinA = Bus.Processor(shouldEnableJoin, K.M, K.isJoinAvailable)
|
|
|
|
public init() { }
|
|
|
|
public var body: some View {
|
|
VStack {
|
|
HStack {
|
|
Text("Check text field:")
|
|
Text("'\(txtF.value)'")
|
|
.fontWeight(.bold)
|
|
}
|
|
|
|
TextField("Binding-3", value: $txtF.value, formatter: Cord.TextFieldValueOwner())
|
|
.padding(8)
|
|
.border(Color.blue, width: 2)
|
|
|
|
Button(action: join.press.send) {
|
|
Text("Join")
|
|
.padding(8)
|
|
.border(
|
|
isJA.value ? Color.green : Color.gray,
|
|
width: isJA.value ? 4 : 1
|
|
)
|
|
}
|
|
.disabled(!isJA.value)
|
|
}
|
|
.frame(width: 320)
|
|
.padding()
|
|
}
|
|
}
|
|
}
|