Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/monarch
This commit is contained in:
commit
2bf63fcb1a
@ -92,19 +92,31 @@ public struct DeprecatedHeadlineBodyHelper {
|
|||||||
public func createTitleLockupModel(defaultStyle: HeadlineBodyModel.Style = .header, headlineBody: HeadlineBodyModel) throws -> TitleLockupModel {
|
public func createTitleLockupModel(defaultStyle: HeadlineBodyModel.Style = .header, headlineBody: HeadlineBodyModel) throws -> TitleLockupModel {
|
||||||
guard let headline = headlineBody.headline else { throw ModelRegistry.Error.decoderOther(message: "headline is required for this use case.") }
|
guard let headline = headlineBody.headline else { throw ModelRegistry.Error.decoderOther(message: "headline is required for this use case.") }
|
||||||
let body = headlineBody.body
|
let body = headlineBody.body
|
||||||
|
var defaultHeadlineStyle: Styler.Font
|
||||||
|
var defaultBodyStyle: Styler.Font
|
||||||
switch headlineBody.style ?? defaultStyle {
|
switch headlineBody.style ?? defaultStyle {
|
||||||
case .landingHeader:
|
case .landingHeader:
|
||||||
headline.fontStyle = Styler.Font.RegularTitle2XLarge
|
defaultHeadlineStyle = Styler.Font.RegularTitle2XLarge
|
||||||
body?.fontStyle = Styler.Font.RegularTitleMedium
|
defaultBodyStyle = Styler.Font.RegularTitleMedium
|
||||||
case .itemHeader:
|
case .itemHeader:
|
||||||
headline.fontStyle = Styler.Font.BoldTitleLarge
|
defaultHeadlineStyle = Styler.Font.BoldTitleLarge
|
||||||
body?.fontStyle = Styler.Font.RegularBodyLarge
|
defaultBodyStyle = Styler.Font.RegularBodyLarge
|
||||||
default:
|
default:
|
||||||
headline.fontStyle = Styler.Font.RegularTitleXLarge
|
defaultHeadlineStyle = Styler.Font.RegularTitleXLarge
|
||||||
body?.fontStyle = Styler.Font.RegularTitleMedium
|
defaultBodyStyle = Styler.Font.RegularTitleMedium
|
||||||
|
}
|
||||||
|
if headline.fontStyle == nil {
|
||||||
|
headline.fontStyle = defaultHeadlineStyle
|
||||||
|
}
|
||||||
|
if body?.fontStyle == nil {
|
||||||
|
body?.fontStyle = defaultBodyStyle
|
||||||
}
|
}
|
||||||
let model = TitleLockupModel(title: headline, subTitle: body)
|
let model = TitleLockupModel(title: headline, subTitle: body)
|
||||||
model.id = headlineBody.id
|
model.id = headlineBody.id
|
||||||
|
if let textAlignment = headline.textAlignment ?? body?.textAlignment,
|
||||||
|
textAlignment == .center {
|
||||||
|
model.textAlignment = .center
|
||||||
|
}
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ open class CarouselItem: MoleculeCollectionViewCell, CarouselItemProtocol {
|
|||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
clipsToBounds = true
|
clipsToBounds = false
|
||||||
|
|
||||||
// Covers the card when peaking.
|
// Covers the card when peaking.
|
||||||
peakingCover.backgroundColor = .white
|
peakingCover.backgroundColor = .white
|
||||||
|
|||||||
@ -125,6 +125,7 @@ open class Carousel: View {
|
|||||||
collectionView.dataSource = self
|
collectionView.dataSource = self
|
||||||
collectionView.delegate = self
|
collectionView.delegate = self
|
||||||
collectionView.bounces = false
|
collectionView.bounces = false
|
||||||
|
collectionView.clipsToBounds = false
|
||||||
addSubview(collectionView)
|
addSubview(collectionView)
|
||||||
bottomPin = NSLayoutConstraint.constraintPinSubview(toSuperview: collectionView)?[ConstraintBot] as? NSLayoutConstraint
|
bottomPin = NSLayoutConstraint.constraintPinSubview(toSuperview: collectionView)?[ConstraintBot] as? NSLayoutConstraint
|
||||||
collectionViewHeight = collectionView.heightAnchor.constraint(equalToConstant: 300)
|
collectionViewHeight = collectionView.heightAnchor.constraint(equalToConstant: 300)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user