No Description

RegisterView.swift 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // RegisterView.swift
  3. // Comedores Sociales
  4. //
  5. // Created by Hector Carrion on 10/24/20.
  6. //
  7. import SwiftUI
  8. struct RegisterView: View {
  9. @State var firstName: String = ""
  10. @State var lastName: String = ""
  11. @State var phoneNumber: String = ""
  12. @State var email: String = ""
  13. @State var password: String = ""
  14. @Environment(\.colorScheme) var colorScheme
  15. var body: some View {
  16. VStack {
  17. Text("Details")
  18. .font(.largeTitle)
  19. .fontWeight(.semibold)
  20. .frame(width: 350, height: 25, alignment: .topLeading)
  21. .padding(.bottom, 20)
  22. TextField("First Name", text: $firstName)
  23. .padding()
  24. .background(colorScheme == .dark ? darkGreyColor : lightGreyColor)
  25. .cornerRadius(5.0)
  26. .padding(.bottom, 5)
  27. TextField("Last Name", text: $lastName)
  28. .padding()
  29. .background(colorScheme == .dark ? darkGreyColor : lightGreyColor)
  30. .cornerRadius(5.0)
  31. .padding(.bottom, 5)
  32. TextField("Phone Number", text: $phoneNumber)
  33. .keyboardType(.numberPad)
  34. .padding()
  35. .background(colorScheme == .dark ? darkGreyColor : lightGreyColor)
  36. .cornerRadius(5.0)
  37. .padding(.bottom, 5)
  38. TextField("Email", text: $email)
  39. .autocapitalization(.none)
  40. .padding()
  41. .background(colorScheme == .dark ? darkGreyColor : lightGreyColor)
  42. .cornerRadius(5.0)
  43. .padding(.bottom, 5)
  44. SecureField("Password", text: $password)
  45. .autocapitalization(.none)
  46. .padding()
  47. .background(colorScheme == .dark ? darkGreyColor : lightGreyColor)
  48. .cornerRadius(5.0)
  49. .padding(.bottom, 20)
  50. Button(action: {print("register tapped")}) {
  51. Text("Register")
  52. .font(.headline)
  53. .foregroundColor(.white)
  54. .padding()
  55. .frame(width: 220, height: 50)
  56. .background(Color.blue)
  57. .cornerRadius(5)
  58. .padding(.bottom, 5)
  59. }
  60. }.padding()
  61. }
  62. }
  63. struct RegisterView_Previews: PreviewProvider {
  64. static var previews: some View {
  65. RegisterView()
  66. }
  67. }