diff --git a/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift b/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift index 170632b512..5855c00563 100644 --- a/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift +++ b/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Utils/StringUtils.swift @@ -308,12 +308,14 @@ public class StringUtils { public var enterPhoneNumberLabel: String { return localizedString(for: "Enter phone number") } + /// Phone provider /// found in: /// - PhoneAuthButtonView public var phoneNumberVerificationCodeLabel: String { return localizedString(for: "Enter verification code") } + /// Phone provider /// found in: /// - PhoneAuthButtonView diff --git a/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift b/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift index 232e853aef..12d880ff56 100644 --- a/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift +++ b/FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift @@ -32,8 +32,12 @@ extension AuthPickerView: View { Text(authService.authenticationFlow == .login ? authService.string .emailLoginFlowLabel : authService.string.emailSignUpFlowLabel) VStack { Divider() } + EmailAuthView() - authService.renderButtons() + VStack { + authService.renderButtons() + }.padding(.horizontal) + VStack { Divider() } HStack { Text(authService diff --git a/FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift b/FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift index c04b3e0898..78378a3b93 100644 --- a/FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift +++ b/FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift @@ -64,12 +64,13 @@ extension SignInWithFacebookButton: View { }) { HStack { Image(systemName: "f.circle.fill") - .font(.title) + .font(.title2) .foregroundColor(.white) Text(authService.string.facebookLoginButtonLabel) .fontWeight(.semibold) .foregroundColor(.white) } + .frame(maxWidth: .infinity, alignment: .leading) .padding() .frame(maxWidth: .infinity) .background(Color.blue) diff --git a/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderAuthUI.swift b/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderAuthUI.swift index 0879fea4c7..3fdde26635 100644 --- a/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderAuthUI.swift +++ b/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderAuthUI.swift @@ -27,7 +27,12 @@ public class GoogleProviderAuthUI: @preconcurrency GoogleProviderAuthUIProtocol } @MainActor public func authButton() -> AnyView { - AnyView(GoogleSignInButton { + let customViewModel = GoogleSignInButtonViewModel( + scheme: .light, + style: .wide, + state: .normal + ) + return AnyView(GoogleSignInButton(viewModel: customViewModel) { Task { try await self.signInWithGoogle(clientID: self.clientID) } diff --git a/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Views/SignInWithGoogleButton.swift b/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Views/SignInWithGoogleButton.swift deleted file mode 100644 index a7b8d79796..0000000000 --- a/FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Views/SignInWithGoogleButton.swift +++ /dev/null @@ -1,58 +0,0 @@ -import FirebaseAuthSwiftUI -import FirebaseCore -import SwiftUI - -@MainActor -public struct SignInWithGoogleButton { - @Environment(AuthService.self) private var authService - - public init() {} - - private func signInWithGoogle() async { - do { - try await authService.signInWithGoogle() - } catch {} - } -} - -extension SignInWithGoogleButton: View { - public var body: some View { - Button(action: { - Task { - try await signInWithGoogle() - } - }) { - if authService.authenticationState != .authenticating { - HStack { - Image(systemName: "globe") // Placeholder for Google logo - .resizable() - .frame(width: 20, height: 20) - .padding(.leading, 8) - - Text(authService - .authenticationFlow == .login ? "Login with Google" : "Sign-up with Google") - .foregroundColor(.black) - .padding(.vertical, 8) - .frame(maxWidth: .infinity) - } - .background(Color.white) - .cornerRadius(8) - .overlay( - RoundedRectangle(cornerRadius: 8) - .stroke(Color.gray, lineWidth: 1) - ) - } else { - ProgressView() - .progressViewStyle(CircularProgressViewStyle(tint: .white)) - .padding(.vertical, 8) - .frame(maxWidth: .infinity) - } - } - } -} - -#Preview { - FirebaseOptions.dummyConfigurationForPreview() - return SignInWithGoogleButton() - .environment(AuthService()) -}