ONEAPP-6360 - Notification - Accessiblity issues
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0f7d50eca4
commit
40dbc51b75
@ -39,18 +39,32 @@ open class Notification: View {
|
||||
public enum Style: String, CaseIterable {
|
||||
case info, success, warning, error
|
||||
|
||||
func iconName() -> Icon.Name {
|
||||
var iconName: Icon.Name {
|
||||
switch self {
|
||||
case .info:
|
||||
return .infoBold
|
||||
.infoBold
|
||||
case .success:
|
||||
return .checkmarkAltBold
|
||||
.checkmarkAltBold
|
||||
case .warning:
|
||||
return .warningBold
|
||||
.warningBold
|
||||
case .error:
|
||||
return .errorBold
|
||||
.errorBold
|
||||
}
|
||||
}
|
||||
|
||||
var accessibilityText: String {
|
||||
switch self {
|
||||
case .info:
|
||||
"Information Message"
|
||||
case .success:
|
||||
"Success Message"
|
||||
case .warning:
|
||||
"Warning Message"
|
||||
case .error:
|
||||
"Catastrophic Warning Alert"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -309,8 +323,9 @@ open class Notification: View {
|
||||
//--------------------------------------------------
|
||||
private func updateIcons() {
|
||||
let iconColor = surface == .dark ? VDSColor.paletteWhite : VDSColor.paletteBlack
|
||||
typeIcon.name = style.iconName()
|
||||
typeIcon.name = style.iconName
|
||||
typeIcon.color = iconColor
|
||||
typeIcon.accessibilityLabel = style.accessibilityText
|
||||
closeButton.color = iconColor
|
||||
closeButton.isHidden = hideCloseButton
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user