Tweaked the UI and localisations in the LoginView view for the Login module.

This commit is contained in:
Javier Cicchelli 2022-12-15 02:23:12 +01:00
parent c735bd0381
commit 6286086d2c
3 changed files with 11 additions and 8 deletions

View File

@ -6,10 +6,11 @@
Copyright © 2022 Röck+Cöde. All rights reserved. Copyright © 2022 Röck+Cöde. All rights reserved.
*/ */
// LoginView
"login.title.text" = "My files"; "login.title.text" = "My files";
"login.text_field.username.placeholder" = "Username"; "login.text_field.username.placeholder" = "Username";
"login.text_field.password.placeholder" = "Password"; "login.text_field.password.placeholder" = "Password";
"login.button.log_in.text" = "Log in"; "login.button.log_in.text" = "Log in";
"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_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.\n\nPlease try again at a later time.";
"login.error.authentication_unknown.text" = "An unexpected error occurred while trying to authenticate your credentials.\nPlease try again at a later time.";

View File

@ -79,15 +79,16 @@ struct LoginForm: View {
comment: "The error message received from the backend." comment: "The error message received from the backend."
) )
) )
.foregroundColor(.secondary)
.font(.body) .font(.body)
.foregroundColor(.red)
.frame(maxWidth: .infinity)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
.padding(.horizontal, 24)
} }
} }
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.padding(16) .padding(16)
.background(Color.primary.colorInvert()) .background(Color.secondary.colorInvert())
.cornerRadius(8) .cornerRadius(8)
.onAppear { .onAppear {
setClearButtonIfNeeded() setClearButtonIfNeeded()

View File

@ -38,7 +38,8 @@ public struct LoginView: View {
.padding(.horizontal, 24) .padding(.horizontal, 24)
.padding(.top, containerTopPadding) .padding(.top, containerTopPadding)
} }
.background(Color.red) .background(Color.primary.colorInvert())
.ignoresSafeArea()
.overlay(ViewHeightGeometry()) .overlay(ViewHeightGeometry())
.onPreferenceChange(ViewHeightPreferenceKey.self) { height in .onPreferenceChange(ViewHeightPreferenceKey.self) { height in
containerTopPadding = height * 0.1 containerTopPadding = height * 0.1
@ -107,7 +108,7 @@ fileprivate extension LoginView {
} }
.labelStyle(.logIn) .labelStyle(.logIn)
} }
.tint(.orange) .tint(.red)
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
.buttonBorderShape(.roundedRectangle(radius: 8)) .buttonBorderShape(.roundedRectangle(radius: 8))
.controlSize(.large) .controlSize(.large)