From 6286086d2cfd011e3549d7838764462b34ea4ad7 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Thu, 15 Dec 2022 02:23:12 +0100 Subject: [PATCH] Tweaked the UI and localisations in the LoginView view for the Login module. --- .../Sources/Login/Resources/en.lproj/Localizable.strings | 7 ++++--- Modules/Sources/Login/UI/Components/LoginForm.swift | 7 ++++--- Modules/Sources/Login/UI/Views/LoginView.swift | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Modules/Sources/Login/Resources/en.lproj/Localizable.strings b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings index f571afc..38fe90b 100644 --- a/Modules/Sources/Login/Resources/en.lproj/Localizable.strings +++ b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings @@ -6,10 +6,11 @@ Copyright © 2022 Röck+Cöde. All rights reserved. */ +// LoginView + "login.title.text" = "My files"; "login.text_field.username.placeholder" = "Username"; "login.text_field.password.placeholder" = "Password"; "login.button.log_in.text" = "Log in"; - -"login.error.authentication_failed.text" = "The given username and/or password are not correct.\nPlease re-enter your credentials and try again."; -"login.error.authentication_unknown.text" = "An unexpected error occurred while trying to authenticate your credentials.\nPlease try again at a later time."; +"login.error.authentication_failed.text" = "The provided username and/or password do not match your records.\n\nPlease confirm your credentials and try again."; +"login.error.authentication_unknown.text" = "An unexpected error occurred while trying to authenticate your credentials.\n\nPlease try again at a later time."; diff --git a/Modules/Sources/Login/UI/Components/LoginForm.swift b/Modules/Sources/Login/UI/Components/LoginForm.swift index 5bb0711..fe2d598 100644 --- a/Modules/Sources/Login/UI/Components/LoginForm.swift +++ b/Modules/Sources/Login/UI/Components/LoginForm.swift @@ -79,15 +79,16 @@ struct LoginForm: View { comment: "The error message received from the backend." ) ) + .foregroundColor(.secondary) .font(.body) - .foregroundColor(.red) - .frame(maxWidth: .infinity) .multilineTextAlignment(.center) + .frame(maxWidth: .infinity) + .padding(.horizontal, 24) } } .frame(maxWidth: .infinity, alignment: .leading) .padding(16) - .background(Color.primary.colorInvert()) + .background(Color.secondary.colorInvert()) .cornerRadius(8) .onAppear { setClearButtonIfNeeded() diff --git a/Modules/Sources/Login/UI/Views/LoginView.swift b/Modules/Sources/Login/UI/Views/LoginView.swift index 16fac56..a88dade 100644 --- a/Modules/Sources/Login/UI/Views/LoginView.swift +++ b/Modules/Sources/Login/UI/Views/LoginView.swift @@ -38,7 +38,8 @@ public struct LoginView: View { .padding(.horizontal, 24) .padding(.top, containerTopPadding) } - .background(Color.red) + .background(Color.primary.colorInvert()) + .ignoresSafeArea() .overlay(ViewHeightGeometry()) .onPreferenceChange(ViewHeightPreferenceKey.self) { height in containerTopPadding = height * 0.1 @@ -107,7 +108,7 @@ fileprivate extension LoginView { } .labelStyle(.logIn) } - .tint(.orange) + .tint(.red) .buttonStyle(.borderedProminent) .buttonBorderShape(.roundedRectangle(radius: 8)) .controlSize(.large)