refactored naming conventions
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
fb623627bf
commit
aa30561b29
@ -14,7 +14,7 @@ extension Tilelet {
|
|||||||
// MARK: - Enums
|
// MARK: - Enums
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Enum used to describe the textStyle of the subTitle label.
|
/// Enum used to describe the textStyle of the subTitle label.
|
||||||
public enum StandardStyle: String, EnumSubset {
|
public enum OtherStandardStyle: String, EnumSubset {
|
||||||
case bodyLarge
|
case bodyLarge
|
||||||
case bodyMedium
|
case bodyMedium
|
||||||
case bodySmall
|
case bodySmall
|
||||||
@ -28,7 +28,7 @@ extension Tilelet {
|
|||||||
public var text: String = ""
|
public var text: String = ""
|
||||||
|
|
||||||
/// Text style that will be used for the subTitle label.
|
/// Text style that will be used for the subTitle label.
|
||||||
public var standardStyle: StandardStyle = .bodySmall
|
public var otherStandardStyle: OtherStandardStyle = .bodySmall
|
||||||
|
|
||||||
/// Text attributes that will be used for the subTitle label.
|
/// Text attributes that will be used for the subTitle label.
|
||||||
public var textAttributes: [any LabelAttributeModel]?
|
public var textAttributes: [any LabelAttributeModel]?
|
||||||
@ -40,13 +40,13 @@ extension Tilelet {
|
|||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public init(text: String,
|
public init(text: String,
|
||||||
|
otherStandardStyle: OtherStandardStyle = .bodySmall,
|
||||||
textColor: Use = .primary,
|
textColor: Use = .primary,
|
||||||
textAttributes: [any LabelAttributeModel]? = nil,
|
textAttributes: [any LabelAttributeModel]? = nil) {
|
||||||
standardStyle: StandardStyle = .bodySmall) {
|
|
||||||
self.text = text
|
self.text = text
|
||||||
|
self.otherStandardStyle = otherStandardStyle
|
||||||
self.textAttributes = textAttributes
|
self.textAttributes = textAttributes
|
||||||
self.textColor = textColor
|
self.textColor = textColor
|
||||||
self.standardStyle = standardStyle
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -55,7 +55,7 @@ extension Tilelet {
|
|||||||
/// Converts this type of model to a TitleLockup.SubTitleModel.
|
/// Converts this type of model to a TitleLockup.SubTitleModel.
|
||||||
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
|
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
|
||||||
TitleLockup.SubTitleModel(text: text,
|
TitleLockup.SubTitleModel(text: text,
|
||||||
standardStyle: standardStyle.value,
|
otherStandardStyle: otherStandardStyle.value,
|
||||||
textColor: textColor,
|
textColor: textColor,
|
||||||
textAttributes: textAttributes)
|
textAttributes: textAttributes)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ open class TitleLockup: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
private var otherStandardStyle: OtherStandardStyle {
|
private var otherStandardStyle: OtherStandardStyle {
|
||||||
if let subTitleModel, !subTitleModel.text.isEmpty {
|
if let subTitleModel, !subTitleModel.text.isEmpty {
|
||||||
return subTitleModel.standardStyle
|
return subTitleModel.otherStandardStyle
|
||||||
} else if let eyebrowModel, !eyebrowModel.text.isEmpty {
|
} else if let eyebrowModel, !eyebrowModel.text.isEmpty {
|
||||||
return eyebrowModel.standardStyle
|
return eyebrowModel.standardStyle
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ extension TitleLockup {
|
|||||||
public var text: String
|
public var text: String
|
||||||
|
|
||||||
/// Standard style that will be used for the subTitle label.
|
/// Standard style that will be used for the subTitle label.
|
||||||
public var standardStyle: OtherStandardStyle
|
public var otherStandardStyle: OtherStandardStyle
|
||||||
|
|
||||||
/// Text color used in the subtitle label.
|
/// Text color used in the subtitle label.
|
||||||
public var textColor: Use
|
public var textColor: Use
|
||||||
@ -26,19 +26,19 @@ extension TitleLockup {
|
|||||||
public var numberOfLines: Int
|
public var numberOfLines: Int
|
||||||
|
|
||||||
public init(text: String,
|
public init(text: String,
|
||||||
standardStyle: OtherStandardStyle = .bodyLarge,
|
otherStandardStyle: OtherStandardStyle = .bodyLarge,
|
||||||
textColor: Use = .primary,
|
textColor: Use = .primary,
|
||||||
textAttributes: [any LabelAttributeModel]? = nil,
|
textAttributes: [any LabelAttributeModel]? = nil,
|
||||||
numberOfLines: Int = 0) {
|
numberOfLines: Int = 0) {
|
||||||
self.text = text
|
self.text = text
|
||||||
self.standardStyle = standardStyle
|
self.otherStandardStyle = otherStandardStyle
|
||||||
self.textColor = textColor
|
self.textColor = textColor
|
||||||
self.textAttributes = textAttributes
|
self.textAttributes = textAttributes
|
||||||
self.numberOfLines = numberOfLines
|
self.numberOfLines = numberOfLines
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TextStyle used to render the text.
|
/// TextStyle used to render the text.
|
||||||
public var textStyle: TextStyle { standardStyle.value.regular }
|
public var textStyle: TextStyle { otherStandardStyle.value.regular }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user