|
@@ -3,18 +3,20 @@ import SwiftUI |
|
|
|
|
|
|
|
|
extension MeetupId { |
|
|
extension MeetupId { |
|
|
public struct V: View { |
|
|
public struct V: View { |
|
|
@StateObject var isJoinAvailable = BusUI.Value(K.isJoinAvailable, false) |
|
|
|
|
|
@StateObject var isLoading = BusUI.Value(K.isLoading, false) |
|
|
|
|
|
@StateObject var join = BusUI.Button(K.join) |
|
|
|
|
|
@StateObject var textField = BusUI.TextField(K.textApp, K.textUI) |
|
|
|
|
|
|
|
|
let id: String |
|
|
|
|
|
@StateObject var isJoinAvailable = BusUI.ManyValue(K.isJoinAvailable, false) |
|
|
|
|
|
@StateObject var isLoading = BusUI.ManyValue(K.isLoading, false) |
|
|
|
|
|
@StateObject var join = BusUI.ManyButton(K.join) |
|
|
|
|
|
@StateObject var textField = BusUI.ManyTextField(K.textApp, K.textUI) |
|
|
|
|
|
|
|
|
public init() { |
|
|
|
|
|
|
|
|
public init(_ id: String) { |
|
|
|
|
|
self.id = id |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public var body: some View { |
|
|
public var body: some View { |
|
|
VStack(spacing: 8) { |
|
|
VStack(spacing: 8) { |
|
|
HStack { |
|
|
HStack { |
|
|
TextField("Binding-3", value: $textField.v, formatter: BusUI.TextFieldSource()) |
|
|
|
|
|
|
|
|
ManyTextField("Binding-3", value: $textField.v, formatter: BusUI.TextFieldSource()) |
|
|
.disabled(isLoading.v) |
|
|
.disabled(isLoading.v) |
|
|
.padding(8) |
|
|
.padding(8) |
|
|
.border( |
|
|
.border( |
|
@@ -27,7 +29,7 @@ extension MeetupId { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Button(action: join.v.send) { |
|
|
|
|
|
|
|
|
ManyButton(action: join.v.send) { |
|
|
Text("Join") |
|
|
Text("Join") |
|
|
.padding(8) |
|
|
.padding(8) |
|
|
.border( |
|
|
.border( |
|
@@ -40,6 +42,18 @@ extension MeetupId { |
|
|
.frame(width: 320) |
|
|
.frame(width: 320) |
|
|
.padding() |
|
|
.padding() |
|
|
.animation(.easeInOut(duration: 0.3)) |
|
|
.animation(.easeInOut(duration: 0.3)) |
|
|
|
|
|
.onAppear { |
|
|
|
|
|
isJoinAvailable.id = id |
|
|
|
|
|
isLoading.id = id |
|
|
|
|
|
join.id = id |
|
|
|
|
|
textField.id = id |
|
|
|
|
|
} |
|
|
|
|
|
.onChange(of: id) { newValue in |
|
|
|
|
|
isJoinAvailable.id = newValue |
|
|
|
|
|
isLoading.id = newValue |
|
|
|
|
|
join.id = newValue |
|
|
|
|
|
textField.id = newValue |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |