Skip to content

Commit f507471

Browse files
committed
Consolidate title and detail text colors in PointOfSaleItemListCardConstants.
1 parent 1984012 commit f507471

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

WooCommerce/Classes/POS/Presentation/Item Selector/ParentProductCardView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ struct ParentProductCardView: View {
2828
VStack(alignment: .leading, spacing: Constants.textSpacing) {
2929
Text(name)
3030
.lineLimit(2)
31-
.foregroundStyle(Color.posPrimaryText)
31+
.foregroundStyle(Constants.titleColor)
3232
.multilineTextAlignment(.leading)
3333
.font(Constants.itemTitleFont)
3434

3535
Text(detailText)
36-
.foregroundStyle(Color.posSecondaryText)
36+
.foregroundStyle(Constants.detailColor)
3737
.font(Constants.itemDetailFont)
3838
}
3939
.padding(.horizontal, Constants.horizontalTextPadding * (1 / scale))

WooCommerce/Classes/POS/Presentation/Item Selector/PointOfSaleItemListCardConstants.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ enum PointOfSaleItemListCardConstants {
1313
static let accessoryButtonMaxWidth: CGFloat = 136
1414
static let accessoryButtonPadding: CGFloat = 16
1515
static let backgroundColor: Color = .posSurfaceContainerLowest
16+
static let titleColor: Color = .posOnSurface
17+
static let detailColor: Color = .posOnSurfaceVariantHighest
1618
}

WooCommerce/Classes/POS/Presentation/Item Selector/SimpleProductCardView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ struct SimpleProductCardView: View {
2525
VStack(alignment: .leading, spacing: Constants.textSpacing) {
2626
Text(product.name)
2727
.lineLimit(2)
28-
.foregroundStyle(Color.posPrimaryText)
28+
.foregroundStyle(Constants.titleColor)
2929
.multilineTextAlignment(.leading)
3030
.font(Constants.itemTitleFont)
3131

3232
Text(product.formattedPrice)
33-
.foregroundStyle(Color.posSecondaryText)
33+
.foregroundStyle(Constants.detailColor)
3434
.font(Constants.itemDetailFont)
3535
}
3636
.padding(.horizontal, Constants.horizontalTextPadding * (1 / scale))

WooCommerce/Classes/POS/Presentation/Item Selector/VariationCardView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ struct VariationCardView: View {
2424
VStack(alignment: .leading, spacing: Constants.textSpacing) {
2525
Text(variation.name)
2626
.lineLimit(2)
27-
.foregroundStyle(Color.posPrimaryText)
27+
.foregroundStyle(Constants.titleColor)
2828
.multilineTextAlignment(.leading)
2929
.font(Constants.itemTitleFont)
3030

3131
Text(variation.formattedPrice)
32-
.foregroundStyle(Color.posSecondaryText)
32+
.foregroundStyle(Constants.detailColor)
3333
.font(Constants.itemDetailFont)
3434
}
3535
.padding(.horizontal, Constants.horizontalTextPadding * (1 / scale))

WooCommerce/Classes/POS/Presentation/ItemRowView.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ struct ItemRowView: View {
55
private let onItemRemoveTapped: (() -> Void)?
66

77
@ScaledMetric private var scale: CGFloat = 1.0
8-
@Environment(\.colorScheme) var colorScheme
98
@Binding private var showProductImage: Bool
109

1110
private var dimension: CGFloat {
@@ -24,15 +23,15 @@ struct ItemRowView: View {
2423

2524
VStack(alignment: .leading, spacing: Constants.itemTitleAndPriceSpacing * (1 / scale)) {
2625
Text(cartItem.title)
27-
.foregroundColor(Color.posPrimaryText)
26+
.foregroundColor(PointOfSaleItemListCardConstants.titleColor)
2827
.font(Constants.itemTitleFont)
2928
if let subtitle = cartItem.subtitle {
3029
Text(subtitle)
31-
.foregroundColor(Color.posSecondaryText)
30+
.foregroundColor(PointOfSaleItemListCardConstants.detailColor)
3231
.font(Constants.itemSubtitleFont)
3332
}
3433
Text(cartItem.item.formattedPrice)
35-
.foregroundColor(Color.posSecondaryText)
34+
.foregroundColor(PointOfSaleItemListCardConstants.detailColor)
3635
.font(Constants.itemPriceFont)
3736
}
3837
.frame(maxWidth: .infinity, alignment: .leading)

0 commit comments

Comments
 (0)