|
|
@@ -0,0 +1,40 @@ |
|
|
|
import BusX |
|
|
|
import CordX |
|
|
|
import SwiftUI |
|
|
|
|
|
|
|
extension MeetupId { |
|
|
|
public struct V: View { |
|
|
|
@StateObject var isJA = Cord.Receive(K.meetupIdIsJoinAvailable.rawValue, false) |
|
|
|
@StateObject var join = Cord.Button(K.meetupIdJoin.rawValue) |
|
|
|
@StateObject var txtF = Cord.TextField(K.meetupIdTextApp.rawValue, K.meetupIdTextUI.rawValue) |
|
|
|
let test = Bus.Processor(K.meetupIdTextUI.rawValue, K.meetupIdIsJoinAvailable.rawValue, onlyAllowJoin) |
|
|
|
|
|
|
|
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() |
|
|
|
} |
|
|
|
} |
|
|
|
} |