From e6e954c7ad5682070ebd059885e4f42dbaae6576 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 13 Jul 2022 09:16:16 -0700 Subject: [PATCH] set username as available when validation api returns void --- .../Sources/App/Views/Registration/CreateProfileView.swift | 4 ++++ apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift index 2b8e71003..d06681338 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift @@ -56,6 +56,7 @@ import Views Task { do { try await dataService.validateUsernamePublisher(username: username) + potentialUsernameStatus = .available } catch { let usernameError = (error as? UsernameAvailabilityError) ?? .unknown switch usernameError { @@ -152,6 +153,9 @@ struct CreateProfileView: View { .font(.appFootnote) .foregroundColor(.appGrayText) TextField("", text: $viewModel.potentialUsername) + #if os(iOS) + .textInputAutocapitalization(.never) + #endif } if viewModel.potentialUsernameStatus == .available { diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 6905cd969..3f9009c04 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -132,7 +132,7 @@ struct WelcomeView: View { } var authProviderButtonStack: some View { - let useHorizontalLayout = containerSize.width > 400 + let useHorizontalLayout = containerSize.width > 500 let buttonGroup = Group { AppleSignInButton { @@ -166,7 +166,7 @@ struct WelcomeView: View { } public var body: some View { - ZStack(alignment: .leading) { + ZStack(alignment: viewModel.registrationState == nil ? .leading : .center) { Color.appBackground .edgesIgnoringSafeArea(.all) .modifier(SizeModifier()) @@ -189,7 +189,7 @@ struct WelcomeView: View { logoView .padding(.bottom, 20) headlineView - if containerSize.width > 400 { + if containerSize.width > 500 { authProviderButtonStack } else { HStack {