From 3dd249564e6dd4dcb9f69f9efc2da9d8a4488e56 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Tue, 26 Jul 2022 15:21:28 -0700 Subject: [PATCH] stub in email auth modal --- .../Sources/App/Views/WelcomeView.swift | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index f7361e714..289506352 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -17,6 +17,7 @@ struct WelcomeView: View { @State private var showTermsLinks = false @State private var showTermsModal = false @State private var showPrivacyModal = false + @State private var showEmailLoginModal = false @State private var showAboutPage = false @State private var selectedEnvironment = AppEnvironment.initialAppEnvironment @State private var containerSize: CGSize = .zero @@ -138,11 +139,7 @@ struct WelcomeView: View { var authProviderButtonStack: some View { let useHorizontalLayout = containerSize.width > 500 - let buttonGroup = Group { - AppleSignInButton { - viewModel.handleAppleSignInCompletion(result: $0, authenticator: authenticator) - } - + let googleButton = Group { if AppKeys.sharedInstance?.iosClientGoogleId != nil { GoogleAuthButton { Task { @@ -152,12 +149,38 @@ struct WelcomeView: View { } } + let appleButton = AppleSignInButton { + viewModel.handleAppleSignInCompletion(result: $0, authenticator: authenticator) + } + + let emailButton = Button( + action: { showEmailLoginModal = true }, + label: { + Text("Continue with Email") + .foregroundColor(.appGrayTextContrast) + .underline() + } + ) + .padding(.vertical) + return VStack(alignment: .center, spacing: 16) { if useHorizontalLayout { - HStack { buttonGroup } + VStack(alignment: .leading, spacing: 0) { + HStack { + appleButton + googleButton + } + emailButton + } } else { - buttonGroup + VStack(alignment: .leading, spacing: 0) { + VStack(alignment: .leading, spacing: 16) { + appleButton + googleButton + } + emailButton + } } if let loginError = viewModel.loginError { @@ -206,6 +229,9 @@ struct WelcomeView: View { Spacer() } .padding() + .sheet(isPresented: $showEmailLoginModal) { + Text("Email Login") + } .sheet(isPresented: $showDebugModal) { DebugMenuView(selectedEnvironment: $selectedEnvironment) }