d
This commit is contained in:
@@ -5,35 +5,34 @@ 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 isL = Cord.Receive(K.isLoading, false)
|
||||
@StateObject var isJoinAvailable = Cord.Receive(K.isJoinAvailable, false)
|
||||
@StateObject var isLoading = Cord.Receive(K.isLoading, false)
|
||||
@StateObject var join = Cord.Button(K.join)
|
||||
@StateObject var txtF = Cord.TextField(K.textApp, K.textUI)
|
||||
@StateObject var textField = Cord.TextField(K.textApp, K.textUI)
|
||||
let pSEJ = Bus.Processor(shouldEnableJoin, K.M, K.isJoinAvailable)
|
||||
let pSRL = Bus.Processor(shouldResetLoading, K.M, K.isLoading)
|
||||
|
||||
public init() { }
|
||||
|
||||
public var body: some View {
|
||||
VStack {
|
||||
VStack(spacing: 8) {
|
||||
HStack {
|
||||
TextField("Binding-3", value: $txtF.value, formatter: Cord.TextFieldValueOwner())
|
||||
TextField("Binding-3", value: $textField.v, formatter: Cord.TextFieldValueOwner())
|
||||
.padding(8)
|
||||
.border(Color.blue, width: 2)
|
||||
if isL.value {
|
||||
ProgressView()
|
||||
}
|
||||
ProgressView()
|
||||
.padding(8)
|
||||
.opacity(isLoading.v ? 1 : 0)
|
||||
}
|
||||
|
||||
Button(action: join.press.send) {
|
||||
Button(action: join.v.send) {
|
||||
Text("Join")
|
||||
.padding(8)
|
||||
.border(
|
||||
isJA.value ? Color.green : Color.gray,
|
||||
width: isJA.value ? 4 : 1
|
||||
isJoinAvailable.v ? Color.green : Color.gray,
|
||||
width: isJoinAvailable.v ? 4 : 1
|
||||
)
|
||||
}
|
||||
.disabled(!isJA.value)
|
||||
.disabled(!isJoinAvailable.v)
|
||||
}
|
||||
.frame(width: 320)
|
||||
.padding()
|
||||
|
||||
Reference in New Issue
Block a user