Skip to content

Commit

Permalink
Refactor FXIOS-7476 [v120] Highlights card without reviews shown (#16610
Browse files Browse the repository at this point in the history
)

* Check for existing highlights before showing card

* Update font, size and weight for highlights card
  • Loading branch information
thatswinnie authored Sep 27, 2023
1 parent 58671a5 commit e44e65b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Client/Frontend/Fakespot/FakespotViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class FakespotViewModel {
}

var highlightsCardViewModel: FakespotHighlightsCardViewModel? {
guard let highlights = state.productData?.highlights else { return nil }
guard let highlights = state.productData?.highlights, !highlights.items.isEmpty else { return nil }
return FakespotHighlightsCardViewModel(highlights: highlights.items)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FakespotHighlightGroupView: UIView, ThemeApplicable, Notifiable {
private lazy var titleLabel: UILabel = .build { label in
label.adjustsFontForContentSizeCategory = true
label.font = DefaultDynamicFontHelper.preferredFont(
withTextStyle: .headline,
withTextStyle: .subheadline,
size: UX.titleFontSize,
weight: .semibold)
label.numberOfLines = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct FakespotHighlightsCardViewModel {

class FakespotHighlightsCardView: UIView, ThemeApplicable {
private struct UX {
static let titleFontSize: CGFloat = 17
static let titleFontSize: CGFloat = 15
static let buttonFontSize: CGFloat = 16
static let buttonCornerRadius: CGFloat = 12
static let buttonHorizontalInset: CGFloat = 16
Expand All @@ -57,9 +57,9 @@ class FakespotHighlightsCardView: UIView, ThemeApplicable {

private lazy var titleLabel: UILabel = .build { label in
label.adjustsFontForContentSizeCategory = true
label.font = DefaultDynamicFontHelper.preferredFont(
withTextStyle: .headline,
size: UX.titleFontSize)
label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline,
size: UX.titleFontSize,
weight: .semibold)
label.numberOfLines = 0
}

Expand Down

0 comments on commit e44e65b

Please sign in to comment.