Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ extension AuthPickerView: View {
withAnimation {
switchFlow()
}
}) {
}, label: {
Text(authService.authenticationFlow == .signUp ? "Log in" : "Sign up")
.fontWeight(.semibold)
.foregroundColor(.blue)
}
})
}
Text(authService.errorMessage).foregroundColor(.red)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ extension EmailAuthView: View {
if authService.authenticationFlow == .login {
Button(action: {
authService.authView = .passwordRecovery
}) {
}, label: {
Text("Forgotten Password?")
}
})
}

if authService.authenticationFlow == .signUp {
Expand All @@ -108,7 +108,7 @@ extension EmailAuthView: View {
if authService.authenticationFlow == .login { await signInWithEmailPassword() }
else { await createUserWithEmailPassword() }
}
}) {
}, label: {
if authService.authenticationState != .authenticating {
Text(authService.authenticationFlow == .login ? "Log in with password" : "Sign up")
.padding(.vertical, 8)
Expand All @@ -119,16 +119,16 @@ extension EmailAuthView: View {
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
}
})
.disabled(!isValid)
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
.buttonStyle(.borderedProminent)
Button(action: {
authService.authView = .passwordRecovery
}) {
}, label: {
Text("Prefer Email link sign-in?")
}
})
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ extension EmailLinkView: View {
await sendEmailLink()
authService.emailLink = email
}
}) {
}, label: {
Text("Send email sign-in link")
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
})
.disabled(!CommonUtils.isValidEmail(email))
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
Expand All @@ -66,11 +66,11 @@ extension EmailLinkView: View {
}
.navigationBarItems(leading: Button(action: {
authService.authView = .authPicker
}) {
}, label: {
Image(systemName: "chevron.left")
.foregroundColor(.blue)
Text("Back")
.foregroundColor(.blue)
})
}))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ extension PasswordRecoveryView: View {
Task {
await sendPasswordRecoveryEmail()
}
}) {
}, label: {
Text("Password Recovery")
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
})
.disabled(!CommonUtils.isValidEmail(email))
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
Expand All @@ -59,11 +59,11 @@ extension PasswordRecoveryView: View {
}
.navigationBarItems(leading: Button(action: {
authService.authView = .authPicker
}) {
}, label: {
Image(systemName: "chevron.left")
.foregroundColor(.blue)
Text("Back")
.foregroundColor(.blue)
})
}))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ extension VerifyEmailView: View {
Task {
await sendEmailVerification()
}
}) {
}, label: {
Text("Verify email address?")
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
})
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
.buttonStyle(.borderedProminent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension SignInWithFacebookButton: View {
}
}
}
}) {
}, label: {
HStack {
Image(systemName: "f.circle.fill")
.font(.title)
Expand All @@ -73,7 +73,7 @@ extension SignInWithFacebookButton: View {
.frame(maxWidth: .infinity)
.background(Color.blue)
.cornerRadius(8)
}
})
.alert(isPresented: $showCanceledAlert) {
Alert(
title: Text("Facebook login cancelled"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension SignInWithGoogleButton: View {
Task {
try await signInWithGoogle()
}
}) {
}, label: {
if authService.authenticationState != .authenticating {
HStack {
Image(systemName: "globe") // Placeholder for Google logo
Expand All @@ -46,6 +46,6 @@ extension SignInWithGoogleButton: View {
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ extension PhoneAuthButtonView: View {
)
}
}
}) {
}, label: {
Text("Send SMS code")
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
})
.disabled(!PhoneUtils.isValidPhoneNumber(phoneNumber))
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
Expand All @@ -69,15 +69,15 @@ extension PhoneAuthButtonView: View {
}
showVerificationCodeInput = false
}
}) {
}, label: {
Text("Verify phone number and sign-in")
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.green)
.cornerRadius(8)
.padding(.horizontal)
}
})
}.onOpenURL { url in
authService.auth.canHandle(url)
}
Expand Down