re-arranged the inputs and added eyebrow is bold

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-03-26 11:44:29 -05:00
parent 70b7d327df
commit 4adee45f62

View File

@ -187,13 +187,14 @@ class TileletViewController: BaseViewController<Tilelet> {
var showDescriptionIconSwitch = Toggle()
var showDirectionalIconSwitch = Toggle()
var badgeTextField = TextField()
var eyebrowIsBold = Toggle().with { $0.isOn = true }
var titleIsBold = Toggle().with { $0.isOn = true }
var colorPickerType: ColorPickerType = .backgroundColor
var selectedGradient1Color: String?
var selectedGradient2Color: String?
var selectedGradientColorView: UIView?
var showDropShadowSwitch = Toggle()
var backgroundColor: BackgroundColor = .secondary
var backgroundColor: BackgroundColor = .black
var maxWidthTextField = NumericField()
var gradientColorsFormStackView = FormSection().with { $0.isHidden = true }
@ -211,16 +212,9 @@ class TileletViewController: BaseViewController<Tilelet> {
addFormRow(label: "Surface", view: surfacePickerSelectorView)
addActionRow()
addFormRow(label: "Clickable", view: clickableSwitch)
addFormRow(label: "Title Style", view: titleStandardStylePickerSelectorView)
addFormRow(label: "Other Style", view: otherStandardStylePickerSelectorView)
addFormRow(label: "Aspect Ratio", view: scalingTypePickerSelectorView)
addFormRow(label: "Padding", view: paddingPickerSelectorView)
addFormRow(label: "Eyebrow Text", view: eyebrowTextField)
addFormRow(label: "Title Text", view: titleTextField)
addFormRow(label: "Title is Bold", view: titleIsBold)
addFormRow(label: "Subtitle Color", view: subtitleColorPickerSelectorView)
addFormRow(label: "Subtitle Text", view: subTitleTextField)
addFormRow(label: "Width", view: widthTextField)
addFormRow(label: "Height", view: heightTextField)
addFormRow(label: "Text Alignment", view: textAlignmentPickerSelectorView)
@ -229,11 +223,23 @@ class TileletViewController: BaseViewController<Tilelet> {
addFormRow(label: "Text Position(Minimum height is configurable.)", view: textPositionPickerSelectorView)
addFormRow(label: "Description Icon", view: showDescriptionIconSwitch)
addFormRow(label: "Directional Icon", view: showDirectionalIconSwitch)
addFormRow(label: "Badge Text", view: badgeTextField)
addFormRow(label: "Badge Fill Color", view: badgeFillColorPickerSelectorView)
addFormRow(label: "Badge Number of Lines", view: badgeNumberOfLinesPickerSelectorView)
addFormRow(label: "Badge Max Width", view: maxWidthTextField)
addFormRow(label: "Aspect Ratio", view: scalingTypePickerSelectorView)
addFormRow(label: "Eyebrow/Subtitle Style", view: otherStandardStylePickerSelectorView)
addFormRow(label: "Eyebrow Text", view: eyebrowTextField)
addFormRow(label: "Eyebrow is Bold", view: eyebrowIsBold)
addFormRow(label: "Title Style", view: titleStandardStylePickerSelectorView)
addFormRow(label: "Title Text", view: titleTextField)
addFormRow(label: "Title is Bold", view: titleIsBold)
addFormRow(label: "Subtitle Color", view: subtitleColorPickerSelectorView)
addFormRow(label: "Subtitle Text", view: subTitleTextField)
addFormRow(label: "Background Color", view: backgroundColorPickerSelectorView)
addFormRow(label: "Background Image", view: showBackgroundImageSwitch)
addFormRow(label: "Show Drop Shadow", view: showDropShadowSwitch)
@ -330,7 +336,11 @@ class TileletViewController: BaseViewController<Tilelet> {
self?.component.directionalIconModel = nil
}
}
eyebrowIsBold.publisher(for: .valueChanged).sink { [weak self] toggle in
self?.setEyebrowModel()
}.store(in: &subscribers)
titleIsBold.publisher(for: .valueChanged).sink { [weak self] toggle in
self?.setTitleModel()
}.store(in: &subscribers)
@ -420,7 +430,7 @@ class TileletViewController: BaseViewController<Tilelet> {
func setEyebrowModel() {
if let text = eyebrowTextField.text, !text.isEmpty {
component.eyebrowModel = Tilelet.EyebrowModel(text: text, standardStyle: otherStandardStylePickerSelectorView.selectedItem)
component.eyebrowModel = Tilelet.EyebrowModel(text: text, isBold: eyebrowIsBold.isOn, standardStyle: otherStandardStylePickerSelectorView.selectedItem)
} else {
component.eyebrowModel = nil
}