// // LoginView.swift // Chat // // Created by Sergey Tarasov on 25.07.2022. // import SwiftUI struct LoginView: View { @ObservedObject var store: LoginStore var body: some View { VStack(alignment: .center, spacing: 16) { TextField("Login", text: $store.login) .textFieldStyle(.roundedBorder) SecureField("Password", text: $store.password) .textFieldStyle(.roundedBorder) .textContentType(.password) Button(action: store.submit) { Text("Login") } } .padding() } } struct LoginView_Previews: PreviewProvider { static var store: LoginStore = LoginStore() static var previews: some View { LoginView(store: store) } }