From 7d14ab1f5c402aa86df5587ebf00fbea14d791cd Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 30 Mar 2023 10:40:10 -0500 Subject: [PATCH] refactored properties Signed-off-by: Matt Bruce --- VDS/Components/Notification/Notification.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index aea2be6d..f0a4d58b 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -101,9 +101,9 @@ public class Notification: View { } //Text - open var titleText: String = "" { didSet{didChange()}} + open var title: String = "" { didSet{didChange()}} - open var subTitleText: String? { didSet{didChange()}} + open var subTitle: String? { didSet{didChange()}} //Buttons open var primaryButtonModel: ButtonModel? { didSet{didChange()}} @@ -195,6 +195,8 @@ public class Notification: View { mainStackView.heightAnchor.constraint(greaterThanOrEqualToConstant: minContentHeight) ]) + labelButtonView.addArrangedSubview(labelsView) + mainStackView.addArrangedSubview(typeIcon) mainStackView.addArrangedSubview(labelButtonView) mainStackView.addArrangedSubview(closeButton) @@ -240,15 +242,15 @@ public class Notification: View { titleLabel.surface = surface subTitleLabel.surface = surface - if !titleText.isEmpty { - titleLabel.text = titleText + if !title.isEmpty { + titleLabel.text = title labelsView.addArrangedSubview(titleLabel) } else { titleLabel.removeFromSuperview() } - if let subTitleText { - subTitleLabel.text = subTitleText + if let subTitle { + subTitleLabel.text = subTitle labelsView.addArrangedSubview(subTitleLabel) } else { subTitleLabel.removeFromSuperview()