// // UserCreationView.swift // PadelClub // // Created by Laurent Morvillier on 13/02/2024. // import SwiftUI import LeStorage struct UserCreationView: View { @State var username: String = "" @State var password1: String = "" @State var password2: String = "" @State var email: String = "" @State var firstName: String = "" @State var lastName: String = "" @State var phone: String = "" @State var showUnmatchingPasswordView = false @State var selectedCountryIndex = 0 let countries: [String] = Locale.countries() var body: some View { Form { Section { TextField("Username", text: self.$username) .autocorrectionDisabled() .textInputAutocapitalization(.never) TextField("Email", text: self.$email) .keyboardType(.emailAddress) .textInputAutocapitalization(.never) } Section { SecureField("Password", text: self.$password1) SecureField("Confirm password", text: self.$password2) } Section { TextField("First Name", text: self.$firstName) .autocorrectionDisabled() TextField("Last Name", text: self.$lastName) .autocorrectionDisabled() TextField("Phone", text: self.$phone) .autocorrectionDisabled() Picker("Select a country", selection: $selectedCountryIndex) { ForEach(0..