1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // LogIn.swift
- // Comedores Sociales
- //
- // Created by Hector Carrion on 10/24/20.
- //
-
- import SwiftUI
-
- struct LoginView: View {
- @State var email: String = ""
- @State var password: String = ""
- @State var showingRegister: Bool = false
-
- var body: some View {
- VStack {
- WelcomeImage()
- WelcomeText()
-
- TextField("Email", text: $email)
- .autocapitalization(.none)
- .padding()
- .background(lightGreyColor)
- .cornerRadius(5.0)
- .padding(.bottom, 5)
- SecureField("Password", text: $password)
- .autocapitalization(.none)
- .padding()
- .background(lightGreyColor)
- .cornerRadius(5.0)
- .padding(.bottom, 20)
-
- Button(action: {print("login tapped")}) {
- LoginText()
- }
-
- Button(action: {self.showingRegister.toggle()}) {
- RegisterText()
- }.sheet(isPresented: $showingRegister, content: {
- RegisterView()
- })
-
- }
- .padding()
- }
- }
-
- struct LogInView_Previews: PreviewProvider {
- static var previews: some View {
- LoginView()
- }
- }
-
- struct WelcomeText: View {
- var body: some View {
- Text("Comedores Sociales")
- .font(.largeTitle)
- .fontWeight(.semibold)
- .padding(.bottom, 20)
- }
- }
-
- struct WelcomeImage: View {
- var body: some View {
- Image("logInImage")
- .resizable()
- .aspectRatio(contentMode: .fill)
- .frame(width: 150, height: 150)
- .clipped()
- //.cornerRadius(150)
- //.padding(.bottom, 75)
- }
- }
-
- struct LoginText: View {
- var body: some View {
- Text("Login")
- .font(.headline)
- .foregroundColor(.white)
- .padding()
- .frame(width: 220, height: 50)
- .background(Color.blue)
- .cornerRadius(5)
- .padding(.bottom, 5)
- }
- }
-
- struct RegisterText: View {
- var body: some View {
- Text("Don't have an account? Register")
- .font(.headline)
- .foregroundColor(.gray)
- .padding()
- .frame(width: 350, height: 50)
- .background(Color.clear)
- .cornerRadius(5)
- }
- }
|