Skip to content

Commit

Permalink
chore: design team feedback to improve app theming capability (#365)
Browse files Browse the repository at this point in the history
* chore: design team feedback to improve app theming capability

* chore: resolve conflicts

* chore: address review feedback

* chore: revert and update sign in & sign up subtitles
  • Loading branch information
saeedbashir authored Mar 29, 2024
1 parent 43056e0 commit 546e6d7
Show file tree
Hide file tree
Showing 31 changed files with 389 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct FieldsView: View {
}
}
Text(.init(text))
.tint(Theme.Colors.accentXColor)
.tint(Theme.Colors.infoColor)
.foregroundStyle(Theme.Colors.textSecondaryLight)
.font(Theme.Fonts.labelSmall)
.padding(.vertical, 3)
Expand Down
29 changes: 17 additions & 12 deletions Authorization/Authorization/Presentation/Login/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,24 @@ public struct SignInView: View {
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 20)
.accessibilityIdentifier("welcome_back_text")

Text(AuthLocalization.SignIn.emailOrUsername)
.font(Theme.Fonts.labelLarge)
.foregroundColor(Theme.Colors.textPrimary)
.accessibilityIdentifier("username_text")
TextField(AuthLocalization.SignIn.emailOrUsername, text: $email)
TextField("", text: $email)
.font(Theme.Fonts.bodyLarge)
.foregroundColor(Theme.Colors.textPrimary)
.foregroundColor(Theme.Colors.textInputTextColor)
.keyboardType(.emailAddress)
.textContentType(.emailAddress)
.autocapitalization(.none)
.autocorrectionDisabled()
.padding(.all, 14)
.background(
Theme.Shapes.textInputShape
.fill(Theme.Colors.textInputBackground)
Theme.InputFieldBackground(
placeHolder: AuthLocalization.SignIn.emailOrUsername,
text: email,
padding: 15
)
)
.overlay(
Theme.Shapes.textInputShape
Expand All @@ -99,13 +101,16 @@ public struct SignInView: View {
.foregroundColor(Theme.Colors.textPrimary)
.padding(.top, 18)
.accessibilityIdentifier("password_text")
SecureField(AuthLocalization.SignIn.password, text: $password)
SecureField("", text: $password)
.font(Theme.Fonts.bodyLarge)
.foregroundColor(Theme.Colors.textPrimary)
.foregroundColor(Theme.Colors.textInputTextColor)
.padding(.all, 14)
.background(
Theme.Shapes.textInputShape
.fill(Theme.Colors.textInputBackground)
Theme.InputFieldBackground(
placeHolder: AuthLocalization.SignIn.password,
text: password,
padding: 15
)
)
.overlay(
Theme.Shapes.textInputShape
Expand All @@ -115,7 +120,7 @@ public struct SignInView: View {
.accessibilityIdentifier("password_textfield")
HStack {
if !viewModel.config.features.startupScreenEnabled {
Button(CoreLocalization.SignIn.registerBtn) {
Button(CoreLocalization.register) {
viewModel.router.showRegisterScreen(sourceScreen: viewModel.sourceScreen)
}
.foregroundColor(Theme.Colors.accentColor)
Expand All @@ -129,7 +134,7 @@ public struct SignInView: View {
viewModel.router.showForgotPasswordScreen()
}
.font(Theme.Fonts.bodyLarge)
.foregroundColor(Theme.Colors.accentXColor)
.foregroundColor(Theme.Colors.infoColor)
.padding(.top, 0)
.accessibilityIdentifier("forgot_password_button")
}
Expand Down Expand Up @@ -222,7 +227,7 @@ public struct SignInView: View {
policy
)
Text(.init(text))
.tint(Theme.Colors.accentXColor)
.tint(Theme.Colors.infoColor)
.foregroundStyle(Theme.Colors.textSecondaryLight)
.font(Theme.Fonts.labelSmall)
.padding(.top, viewModel.socialAuthEnabled ? 0 : 15)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct SignUpView: View {
VStack(alignment: .center) {
ZStack {
HStack {
Text(CoreLocalization.SignIn.registerBtn)
Text(CoreLocalization.register)
.titleSettings(color: Theme.Colors.loginNavigationText)
.accessibilityIdentifier("register_text")
}
Expand All @@ -63,7 +63,7 @@ public struct SignUpView: View {
ScrollView {
VStack(alignment: .leading) {

Text(AuthLocalization.SignUp.title)
Text(CoreLocalization.register)
.font(Theme.Fonts.displaySmall)
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 4)
Expand All @@ -73,7 +73,7 @@ public struct SignUpView: View {
.foregroundColor(Theme.Colors.textPrimary)
.padding(.bottom, 20)
.accessibilityIdentifier("signup_subtitle_text")

if viewModel.thirdPartyAuthSuccess {
Text(AuthLocalization.SignUp.successSigninLabel)
.font(Theme.Fonts.titleMedium)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,20 @@ public struct ResetPasswordView: View {
.font(Theme.Fonts.labelLarge)
.foregroundColor(Theme.Colors.textPrimary)
.accessibilityIdentifier("email_text")
TextField(AuthLocalization.SignIn.email, text: $email)
TextField("", text: $email)
.font(Theme.Fonts.bodyLarge)
.foregroundColor(Theme.Colors.textPrimary)
.foregroundColor(Theme.Colors.textInputTextColor)
.keyboardType(.emailAddress)
.textContentType(.emailAddress)
.autocapitalization(.none)
.autocorrectionDisabled()
.padding(.all, 14)
.background(
Theme.Shapes.textInputShape
.fill(Theme.Colors.textInputBackground)
Theme.InputFieldBackground(
placeHolder: AuthLocalization.SignIn.email,
text: email,
padding: 15
)
)
.overlay(
Theme.Shapes.textInputShape
Expand Down
17 changes: 10 additions & 7 deletions Authorization/Authorization/Presentation/Startup/StartupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public struct StartupView: View {
Image(systemName: "magnifyingglass")
.padding(.leading, 16)
.padding(.top, 1)
.foregroundColor(Theme.Colors.textPrimary)
TextField(AuthLocalization.Startup.searchPlaceholder, text: $searchQuery, onCommit: {
.foregroundColor(Theme.Colors.textInputTextColor)
TextField("", text: $searchQuery, onCommit: {
if searchQuery.isEmpty { return }
viewModel.router.showDiscoveryScreen(
searchQuery: searchQuery,
Expand All @@ -68,7 +68,7 @@ public struct StartupView: View {
.frame(minHeight: 50)
.submitLabel(.search)
.font(Theme.Fonts.bodyLarge)
.foregroundColor(Theme.Colors.textPrimary)
.foregroundColor(Theme.Colors.textInputTextColor)
.accessibilityIdentifier("explore_courses_textfield")

}.overlay(
Expand All @@ -77,19 +77,22 @@ public struct StartupView: View {
.fill(Theme.Colors.textInputStroke)
)
.background(
Theme.Shapes.textInputShape
.fill(Theme.Colors.textInputBackground)
Theme.InputFieldBackground(
placeHolder: AuthLocalization.Startup.searchPlaceholder,
text: searchQuery,
padding: 48
)
)

Button {
viewModel.router.showDiscoveryScreen (
viewModel.router.showDiscoveryScreen(
searchQuery: searchQuery,
sourceScreen: .startup
)
} label: {
Text(AuthLocalization.Startup.exploreAllCourses)
.underline()
.foregroundColor(Theme.Colors.accentXColor)
.foregroundColor(Theme.Colors.infoColor)
.font(Theme.Fonts.bodyLarge)
}
.padding(.top, isHorizontal ? 0 : 5)
Expand Down
10 changes: 4 additions & 6 deletions Authorization/Authorization/SwiftGen/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public enum AuthLocalization {
public static let logInTitle = AuthLocalization.tr("Localizable", "SIGN_IN.LOG_IN_TITLE", fallback: "Sign in")
/// Password
public static let password = AuthLocalization.tr("Localizable", "SIGN_IN.PASSWORD", fallback: "Password")
/// Welcome back! Please authorize to continue.
public static let welcomeBack = AuthLocalization.tr("Localizable", "SIGN_IN.WELCOME_BACK", fallback: "Welcome back! Please authorize to continue.")
/// Welcome back! Sign in to access your courses.
public static let welcomeBack = AuthLocalization.tr("Localizable", "SIGN_IN.WELCOME_BACK", fallback: "Welcome back! Sign in to access your courses.")
}
public enum SignUp {
/// By creating an account, you agree to the [%@ End User License Agreement](%@) and [%@ Terms of Service and Honor Code](%@) and you acknowledge that %@ and each Member process your personal data inaccordance with the [Privacy Policy.](%@)
Expand All @@ -87,14 +87,12 @@ public enum AuthLocalization {
}
/// Show optional Fields
public static let showFields = AuthLocalization.tr("Localizable", "SIGN_UP.SHOW_FIELDS", fallback: "Show optional Fields")
/// Create new account.
public static let subtitle = AuthLocalization.tr("Localizable", "SIGN_UP.SUBTITLE", fallback: "Create new account.")
/// Create an account to start learning today!
public static let subtitle = AuthLocalization.tr("Localizable", "SIGN_UP.SUBTITLE", fallback: "Create an account to start learning today!")
/// You've successfully signed in.
public static let successSigninLabel = AuthLocalization.tr("Localizable", "SIGN_UP.SUCCESS_SIGNIN_LABEL", fallback: "You've successfully signed in.")
/// We just need a little more information before you start learning.
public static let successSigninSublabel = AuthLocalization.tr("Localizable", "SIGN_UP.SUCCESS_SIGNIN_SUBLABEL", fallback: "We just need a little more information before you start learning.")
/// Sign up
public static let title = AuthLocalization.tr("Localizable", "SIGN_UP.TITLE", fallback: "Sign up")
}
public enum Startup {
/// Explore all courses
Expand Down
5 changes: 2 additions & 3 deletions Authorization/Authorization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

"SIGN_IN.LOG_IN_TITLE" = "Sign in";
"SIGN_IN.WELCOME_BACK" = "Welcome back! Please authorize to continue.";
"SIGN_IN.WELCOME_BACK" = "Welcome back! Sign in to access your courses.";
"SIGN_IN.EMAIL" = "Email";
"SIGN_IN.EMAIL_OR_USERNAME" = "Email or username";
"SIGN_IN.PASSWORD" = "Password";
Expand All @@ -22,8 +22,7 @@ accordance with the [Privacy Policy.](%@)";
"ERROR.INVALID_EMAIL_ADDRESS_OR_USERNAME" = "Invalid email or username";
"ERROR.DISABLED_ACCOUNT" = "Your account is disabled. Please contact customer support for assistance.";

"SIGN_UP.TITLE" = "Sign up";
"SIGN_UP.SUBTITLE" = "Create new account.";
"SIGN_UP.SUBTITLE" = "Create an account to start learning today!";
"SIGN_UP.CREATE_ACCOUNT_BTN" = "Create account";
"SIGN_UP.HIDE_FIELDS" = "Hide optional Fields";
"SIGN_UP.SHOW_FIELDS" = "Show optional Fields";
Expand Down
5 changes: 2 additions & 3 deletions Authorization/Authorization/uk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

"SIGN_IN.LOG_IN_TITLE" = "Увійти";
"SIGN_IN.WELCOME_BACK" = "З поверненням! Авторизуйтесь, щоб продовжити.";
"SIGN_IN.WELCOME_BACK" = "Welcome back! Sign in to access your courses.";
"SIGN_IN.EMAIL" = "Пошта";
"SIGN_IN.PASSWORD" = "Пароль";
"SIGN_IN.FORGOT_PASS_BTN" = "Забули пароль?";
Expand All @@ -19,8 +19,7 @@ accordance with the [Privacy Policy.](%@)";
"ERROR.ACCOUNT_NOT_REGISTERED" = "This %@ account is not linked with any %@ account. Please register.";
"ERROR.DISABLED_ACCOUNT" = "Your account is disabled. Please contact customer support for assistance.";

"SIGN_UP.TITLE" = "Зареєструватись";
"SIGN_UP.SUBTITLE" = "Cтворити новий акаунт.";
"SIGN_UP.SUBTITLE" = "Create an account to start learning today!";
"SIGN_UP.CREATE_ACCOUNT_BTN" = "Створити акаунт";
"SIGN_UP.HIDE_FIELDS" = "Приховати необовʼязкові поля";
"SIGN_UP.SHOW_FIELDS" = "Показати необовʼязкові поля";
Expand Down
4 changes: 2 additions & 2 deletions Core/Core/SwiftGen/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public enum CoreLocalization {
public static let done = CoreLocalization.tr("Localizable", "DONE", fallback: "Done")
/// View in Safari
public static let openInBrowser = CoreLocalization.tr("Localizable", "OPEN_IN_BROWSER", fallback: "View in Safari")
/// Register
public static let register = CoreLocalization.tr("Localizable", "REGISTER", fallback: "Register")
/// The user canceled the sign-in flow.
public static let socialSignCanceled = CoreLocalization.tr("Localizable", "SOCIAL_SIGN_CANCELED", fallback: "The user canceled the sign-in flow.")
/// Tomorrow
Expand Down Expand Up @@ -208,8 +210,6 @@ public enum CoreLocalization {
public enum SignIn {
/// Sign in
public static let logInBtn = CoreLocalization.tr("Localizable", "SIGN_IN.LOG_IN_BTN", fallback: "Sign in")
/// Register
public static let registerBtn = CoreLocalization.tr("Localizable", "SIGN_IN.REGISTER_BTN", fallback: "Register")
}
public enum View {
public enum Snackbar {
Expand Down
15 changes: 6 additions & 9 deletions Core/Core/View/Base/FlexibleKeyboardInputView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,15 @@ public struct FlexibleKeyboardInputView: View {
.overlay(
TextEditor(text: $commentText)
.padding(.horizontal, 8)
.foregroundColor(Theme.Colors.textPrimary)
.foregroundColor(Theme.Colors.textInputTextColor)
.hideScrollContentBackground()
.frame(maxHeight: commentSize)
.background(
ZStack(alignment: .leading) {
Theme.Shapes.textInputShape
.fill(Theme.Colors.textInputBackground)
Text(commentText.count == 0 ? hint : "")
.foregroundColor(Theme.Colors.textSecondary)
.font(Theme.Fonts.labelLarge)
.padding(.leading, 14)
}
Theme.InputFieldBackground(
placeHolder: commentText.count == 0 ? hint : "",
text: commentText,
padding: 14
)
)
.overlay(
Theme.Shapes.textInputShape
Expand Down
4 changes: 2 additions & 2 deletions Core/Core/View/Base/LogistrationBottomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct LogistrationBottomView: View {
public var body: some View {
VStack(alignment: .leading) {
HStack(spacing: 24) {
StyledButton(CoreLocalization.SignIn.registerBtn) {
StyledButton(CoreLocalization.register) {
action(.register)
}
.accessibilityIdentifier("logistration_register_button")
Expand All @@ -48,7 +48,7 @@ public struct LogistrationBottomView: View {
action: {
action(.signIn)
},
color: Theme.Colors.white,
color: Theme.Colors.background,
textColor: Theme.Colors.secondaryButtonTextColor,
borderColor: Theme.Colors.secondaryButtonBorderColor
)
Expand Down
Loading

0 comments on commit 546e6d7

Please sign in to comment.