removed color since now this is driven by vds

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-11 14:04:12 -05:00
parent 1048a29891
commit 473c98cca4
2 changed files with 1 additions and 7 deletions

View File

@ -30,7 +30,6 @@ import MVMCore
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? NotificationXButtonModel else { return }
tintColor = model.color?.uiColor ?? .white
// TODO: Temporary, consider action for dismissing top alert
if model.action.actionType == ActionNoopModel.identifier {

View File

@ -15,25 +15,21 @@ public class NotificationXButtonModel: ButtonModelProtocol, MoleculeModelProtoco
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var color: Color?
public var action: ActionModelProtocol = ActionNoopModel()
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case color
case action
}
public init(color: Color? = nil, action: ActionModelProtocol = ActionNoopModel()) {
self.color = color
public init(action: ActionModelProtocol = ActionNoopModel()) {
self.action = action
}
public required init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
color = try typeContainer.decodeIfPresent(Color.self, forKey: .color)
if let action: ActionModelProtocol = try typeContainer.decodeModelIfPresent(codingKey: .action) {
self.action = action
}
@ -43,7 +39,6 @@ public class NotificationXButtonModel: ButtonModelProtocol, MoleculeModelProtoco
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(color, forKey: .color)
try container.encodeModel(action, forKey: .action)
}
}