Commit 1acb0d5d authored by Jose Blaya's avatar Jose Blaya
Browse files

- Update error messages and banner style for PIAX

- Update LoginViewController logic to present the error banner if password is nil
parent 2a5c5801
......@@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "warningIcon.pdf"
"filename" : "warningIconCopy4.pdf"
}
],
"info" : {
......
......@@ -12,6 +12,8 @@ import SwiftEntryKit
extension Macros {
private static let bannerHeight: CGFloat = 78.5
/**
Creates an `UIColor` from its RGBA components.
......@@ -108,17 +110,21 @@ extension Macros {
message: String,
andDuration duration: Double? = nil) {
var attributes = EKAttributes()
attributes = .topToast
attributes.hapticFeedbackType = .success
attributes.entryBackground = .color(color: UIColor.piaRed)
attributes.positionConstraints.size = .init(width: EKAttributes.PositionConstraints.Edge.fill,
height: EKAttributes.PositionConstraints.Edge.constant(value: bannerHeight))
if let duration = duration {
attributes.displayDuration = duration
}
let labelContent = EKProperty.LabelContent(text: message,
style: .init(font: TextStyle.textStyle7.font!,
color: TextStyle.textStyle7.color!))
color: .white))
let imageContent = EKProperty.ImageContent(image: image)
let contentView = EKImageNoteMessageView(with: labelContent,
imageContent: imageContent)
......
......@@ -69,9 +69,15 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
let errorMessage = L10n.Welcome.Login.Error.validation
guard let username = textUsername.text?.trimmed(), !username.isEmpty else {
Macros.displayImageNote(withImage: Asset.iconWarning.image,
message: errorMessage)
self.status = .error(element: textUsername)
if textPassword.text == nil || textPassword.text!.isEmpty {
self.status = .error(element: textPassword)
}
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment