Skip to content

Commit 0dd87d5

Browse files
committed
Update LatestPostSummary cell to have the same style as other Totals cells
1 parent 1f7f0fd commit 0dd87d5

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import UIKit
22
import Gridicons
3+
import DesignSystem
34

45
class StatsLatestPostSummaryInsightsCell: StatsBaseCell, LatestPostSummaryConfigurable {
56
private weak var siteStatsInsightsDelegate: SiteStatsInsightsDelegate?
@@ -140,19 +141,18 @@ class StatsLatestPostSummaryInsightsCell: StatsBaseCell, LatestPostSummaryConfig
140141
let stackView = UIStackView()
141142
stackView.translatesAutoresizingMaskIntoConstraints = false
142143
stackView.axis = .vertical
143-
stackView.spacing = Metrics.statsStackViewVerticalSpacing
144+
stackView.spacing = 0
144145

145146
let topLabel = UILabel()
146-
topLabel.font = UIFont.preferredFont(forTextStyle: .subheadline)
147-
topLabel.textColor = .text
148147
topLabel.text = title
149148
topLabel.adjustsFontSizeToFitWidth = true
149+
topLabel.adjustsFontForContentSizeCategory = true
150+
Style.configureLabelAsCellValueTitle(topLabel)
150151

151-
countLabel.font = Style.insightsCountFont
152-
countLabel.textColor = .text
153152
countLabel.adjustsFontSizeToFitWidth = true
154153
countLabel.adjustsFontForContentSizeCategory = true
155154
countLabel.text = "0"
155+
Style.configureLabelAsCellValue(countLabel)
156156

157157
stackView.addArrangedSubviews([topLabel, countLabel])
158158

@@ -250,13 +250,12 @@ class StatsLatestPostSummaryInsightsCell: StatsBaseCell, LatestPostSummaryConfig
250250
// MARK: - Constants
251251

252252
private enum Metrics {
253-
static let outerStackViewSpacing: CGFloat = 16.0
254-
static let postStackViewHorizontalSpacing: CGFloat = 16.0
255-
static let postStackViewVerticalSpacing: CGFloat = 8.0
256-
static let statsStackViewVerticalSpacing: CGFloat = 8.0
257-
static let createPostButtonInset: CGFloat = 8.0
253+
static let outerStackViewSpacing: CGFloat = Length.Padding.double
254+
static let postStackViewHorizontalSpacing: CGFloat = Length.Padding.double
255+
static let postStackViewVerticalSpacing: CGFloat = Length.Padding.single
256+
static let createPostButtonInset: CGFloat = Length.Padding.single
258257
static let thumbnailSize: CGFloat = 68.0
259-
static let thumbnailCornerRadius: CGFloat = 4.0
258+
static let thumbnailCornerRadius: CGFloat = Length.Padding.half
260259
static let dividerWidth: CGFloat = 1.0
261260
}
262261

WordPress/Classes/ViewRelated/Stats/Shared Views/StatsTotalRow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ private extension StatsTotalRow {
233233
func applyStyles() {
234234
backgroundColor = .listForeground
235235
contentView.backgroundColor = .listForeground
236-
Style.configureLabelAsCellRowTitle(itemLabel)
237-
Style.configureLabelItemDetail(itemDetailLabel)
236+
Style.configureLabelAsCellValueTitle(itemLabel)
237+
Style.configureLabelAsCellValue(itemDetailLabel)
238238
Style.configureLabelAsData(dataLabel)
239239
Style.configureViewAsSeparator(separatorLine)
240240
Style.configureViewAsSeparator(topExpandedSeparatorLine)

0 commit comments

Comments
 (0)