Merge branch 'bugfix/atomic_headers_deprecated' into 'develop'

Digital ACT191 story ONEAPP-7718 - Bugfix for headlineBody legacy mapping to...

### Summary
Bugfix for headlineBody legacy mapping to titleLockup. Remove clipsToBounds to allow shadows.

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-7718

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1112
This commit is contained in:
Bruce, Matt R 2024-05-07 23:05:45 +00:00
commit 758a7f686b
3 changed files with 20 additions and 7 deletions

View File

@ -92,19 +92,31 @@ public struct DeprecatedHeadlineBodyHelper {
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.") }
let body = headlineBody.body
var defaultHeadlineStyle: Styler.Font
var defaultBodyStyle: Styler.Font
switch headlineBody.style ?? defaultStyle {
case .landingHeader:
headline.fontStyle = Styler.Font.RegularTitle2XLarge
body?.fontStyle = Styler.Font.RegularTitleMedium
defaultHeadlineStyle = Styler.Font.RegularTitle2XLarge
defaultBodyStyle = Styler.Font.RegularTitleMedium
case .itemHeader:
headline.fontStyle = Styler.Font.BoldTitleLarge
body?.fontStyle = Styler.Font.RegularBodyLarge
defaultHeadlineStyle = Styler.Font.BoldTitleLarge
defaultBodyStyle = Styler.Font.RegularBodyLarge
default:
headline.fontStyle = Styler.Font.RegularTitleXLarge
body?.fontStyle = Styler.Font.RegularTitleMedium
defaultHeadlineStyle = Styler.Font.RegularTitleXLarge
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)
model.id = headlineBody.id
if let textAlignment = headline.textAlignment ?? body?.textAlignment,
textAlignment == .center {
model.textAlignment = .center
}
return model
}

View File

@ -22,7 +22,7 @@ open class CarouselItem: MoleculeCollectionViewCell, CarouselItemProtocol {
open override func setupView() {
super.setupView()
clipsToBounds = true
clipsToBounds = false
// Covers the card when peaking.
peakingCover.backgroundColor = .white

View File

@ -125,6 +125,7 @@ open class Carousel: View {
collectionView.dataSource = self
collectionView.delegate = self
collectionView.bounces = false
collectionView.clipsToBounds = false
addSubview(collectionView)
bottomPin = NSLayoutConstraint.constraintPinSubview(toSuperview: collectionView)?[ConstraintBot] as? NSLayoutConstraint
collectionViewHeight = collectionView.heightAnchor.constraint(equalToConstant: 300)