diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift index 2a0a32049..a09c6dd88 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/ExpandedAudioPlayer.swift @@ -12,7 +12,6 @@ @EnvironmentObject var dataService: DataService @EnvironmentObject var audioController: AudioController - @Environment(\.colorScheme) private var colorScheme: ColorScheme @Environment(\.dismiss) private var dismiss let delete: (_: NSManagedObjectID) -> Void diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift index 3f977b834..6b14f5ff5 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/CreateProfileView.swift @@ -30,11 +30,10 @@ import Views init() {} - func submitProfile(name: String, bio: String, authenticator: Authenticator) { + func submitProfile(name: String, authenticator: Authenticator) { let profileOrError = NewUserProfile.make( username: potentialUsername, - name: name, - bio: bio.isEmpty ? nil : bio + name: name ) switch profileOrError { @@ -112,7 +111,6 @@ struct CreateProfileView: View { @StateObject private var viewModel = CreateProfileViewModel() @State private var name = "" - @State private var bio = "" init(userProfile: NewUserProfile) { self.initialUserProfile = userProfile @@ -171,29 +169,11 @@ struct CreateProfileView: View { } .animation(.default, value: 0.35) - VStack(alignment: .leading, spacing: 6) { - Text(LocalText.registrationBio) - .font(.appFootnote) - .foregroundColor(.appGrayText) - TextEditor(text: $bio) - .lineSpacing(6) - .accentColor(.appGraySolid) - .foregroundColor(.appGrayText) - .font(.appBody) - .padding(12) - .background( - RoundedRectangle(cornerRadius: 16) - .strokeBorder(Color.appGrayBorder, lineWidth: 1) - .background(RoundedRectangle(cornerRadius: 16).fill(Color.systemBackground)) - ) - .frame(height: 160) - } - Button( - action: { viewModel.submitProfile(name: name, bio: bio, authenticator: authenticator) }, + action: { viewModel.submitProfile(name: name, authenticator: authenticator) }, label: { Text(viewModel.submitButtonText) } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) if let errorMessage = viewModel.validationErrorMessage { Text(errorMessage) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift index 5006b2981..b5f0a336e 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailAuthView.swift @@ -45,7 +45,7 @@ struct EmailAuthView: View { var innerBody: some View { ZStack { - Color.appBackground.edgesIgnoringSafeArea(.all) + Color.themeSolidBackground.edgesIgnoringSafeArea(.all) primaryContent .frame(maxWidth: 300) #if os(iOS) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift index 26a9d3d19..74e20465a 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailLoginFormView.swift @@ -93,7 +93,7 @@ struct EmailLoginFormView: View { }, label: { Text(LocalText.genericSubmit) } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) if let loginError = viewModel.loginError { LoginErrorMessageView(loginError: loginError) @@ -186,7 +186,7 @@ struct EmailPendingVerificationView: View { } } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) HStack { Button( diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift index 9e65232a8..79cb97219 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/EmailAuth/EmailSignupFormView.swift @@ -191,7 +191,7 @@ struct EmailSignupFormView: View { } } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) if let loginError = viewModel.loginError { LoginErrorMessageView(loginError: loginError) diff --git a/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift b/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift index 13e7f0a71..baa1f25bb 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Registration/NewAppleSignupView.swift @@ -50,13 +50,13 @@ struct NewAppleSignupView: View { }, label: { Text(LocalText.genericContinue) } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) Button( action: showProfileEditView, label: { Text(LocalText.registrationChangeUsername) } ) - .buttonStyle(SolidCapsuleButtonStyle(color: .appDeepBackground, width: 300)) + .buttonStyle(SolidCapsuleButtonStyle(color: .appCtaYellow, textColor: Color.themeDarkGray, width: 300)) if let loginError = viewModel.loginError { LoginErrorMessageView(loginError: loginError) diff --git a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift index 77b32451a..cf7a85db7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WelcomeView.swift @@ -159,6 +159,8 @@ struct WelcomeView: View { var logoView: some View { Image.omnivoreTitleLogo + .renderingMode(.template) + .foregroundColor(Color.appGrayTextContrast) .gesture( TapGesture(count: 2) .onEnded { @@ -231,7 +233,7 @@ struct WelcomeView: View { public var body: some View { ZStack(alignment: viewModel.registrationState == nil ? .leading : .center) { - Color.appBackground + Color.themeSolidBackground .edgesIgnoringSafeArea(.all) .modifier(SizeModifier()) .onPreferenceChange(SizePreferenceKey.self) { @@ -286,7 +288,6 @@ struct WelcomeView: View { } } } - .preferredColorScheme(.light) .task { selectedEnvironment = dataService.appEnvironment } } } diff --git a/apple/OmnivoreKit/Sources/Models/DataModels/NewUserProfile.swift b/apple/OmnivoreKit/Sources/Models/DataModels/NewUserProfile.swift index a13c52bcb..c3dd51777 100644 --- a/apple/OmnivoreKit/Sources/Models/DataModels/NewUserProfile.swift +++ b/apple/OmnivoreKit/Sources/Models/DataModels/NewUserProfile.swift @@ -20,13 +20,12 @@ public struct NewUserProfile: Codable { public extension NewUserProfile { static func make( username: String, - name: String, - bio: String? + name: String ) -> Either { let userProfile = NewUserProfile( username: username, name: name, - bio: bio + bio: nil ) if let errorMessage = userProfile.validationErrorMessage { diff --git a/apple/OmnivoreKit/Sources/Services/DataService/GQLSchema.swift b/apple/OmnivoreKit/Sources/Services/DataService/GQLSchema.swift index 99740f24e..56e42410c 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/GQLSchema.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/GQLSchema.swift @@ -38237,6 +38237,8 @@ extension Enums { enum OptInFeatureErrorCode: String, CaseIterable, Codable { case badRequest = "BAD_REQUEST" + case ineligible = "INELIGIBLE" + case notFound = "NOT_FOUND" } } diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/OptIntoFeature.swift b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/OptIntoFeature.swift index 19a9f6060..1bf387bef 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/OptIntoFeature.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/OptIntoFeature.swift @@ -15,6 +15,10 @@ public struct Feature { public let granted: Bool } +public enum IneligibleError: Error { + case message(messageText: String) +} + public extension DataService { func optInFeature(name: String) async throws -> Feature? { enum MutationResult { @@ -51,6 +55,9 @@ public extension DataService { case let .success(feature: feature): continuation.resume(returning: feature) case let .error(errorCode: errorCode): + if errorCode == .ineligible { + continuation.resume(throwing: IneligibleError.message(messageText: "You are not eligible for this feature.")) + } continuation.resume(throwing: BasicError.message(messageText: errorCode.rawValue)) } } diff --git a/apple/OmnivoreKit/Sources/Views/Buttons/AppleSignInButton.swift b/apple/OmnivoreKit/Sources/Views/Buttons/AppleSignInButton.swift index a4e206e52..ea6b33c6a 100644 --- a/apple/OmnivoreKit/Sources/Views/Buttons/AppleSignInButton.swift +++ b/apple/OmnivoreKit/Sources/Views/Buttons/AppleSignInButton.swift @@ -21,6 +21,5 @@ public struct AppleSignInButton: View { .frame(height: 54) .frame(maxWidth: 300) .cornerRadius(8) - .signInWithAppleButtonStyle(.white) } }