From dba9c7df627101721b86393b15e167f8e56c4f09 Mon Sep 17 00:00:00 2001 From: iamgabrielma Date: Thu, 3 Jul 2025 12:28:47 +0700 Subject: [PATCH 1/4] update badge to use POS colors --- WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift b/WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift index d89b2861c0b..6ae46e3090f 100644 --- a/WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift +++ b/WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift @@ -6,8 +6,8 @@ extension UILabel { func applySalesChannelStyle() { applyFootnoteStyle() applyLayerSettings() - backgroundColor = .lightGray - textColor = .black + backgroundColor = Layout.salesChannelLabelBackgroundColor + textColor = Layout.salesChannelLabelTextColor } /// Setup: Layer @@ -23,5 +23,7 @@ private extension UILabel { enum Layout { static let borderWidth = CGFloat(0.0) static let cornerRadius = CGFloat(4.0) + static let salesChannelLabelTextColor = UIColor(named: "posPrimary") + static let salesChannelLabelBackgroundColor = UIColor(named: "posSecondary") } } From 87551753aae0e948d3060b8f396e303406fb8a80 Mon Sep 17 00:00:00 2001 From: iamgabrielma Date: Thu, 3 Jul 2025 17:51:55 +0700 Subject: [PATCH 2/4] Make PaddedLabel and apply POS styles --- .../Order Summary Section/SummaryTableViewCell.swift | 12 +++++++++--- .../Order Summary Section/SummaryTableViewCell.xib | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift index 2abeee9b88c..08ac33c5730 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift @@ -14,7 +14,7 @@ final class SummaryTableViewCell: UITableViewCell { /// Shows the sales channel if appropiate, at the moment only Point of Sale /// - @IBOutlet private weak var salesChannelLabel: UILabel! + @IBOutlet private weak var salesChannelLabel: PaddedLabel! /// Label: Payment Status /// @@ -104,8 +104,7 @@ private extension SummaryTableViewCell { if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.pointOfSaleOrdersi1) { salesChannelLabel.isHidden = false - salesChannelLabel.applyFootnoteStyle() - salesChannelLabel.accessibilityIdentifier = "summary-table-view-cell-sales-channel-label" + configureSalesChannelLabel() } else { salesChannelLabel.isHidden = true } @@ -119,6 +118,13 @@ private extension SummaryTableViewCell { configureIconForVoiceOver() } + func configureSalesChannelLabel() { + salesChannelLabel.numberOfLines = 1 + salesChannelLabel.textInsets = UIEdgeInsets(top: 4, left: 8, bottom: 4, right: 8) + salesChannelLabel.applySalesChannelStyle() + salesChannelLabel.accessibilityIdentifier = "summary-table-view-cell-sales-channel-label" + } + @objc func editWasTapped() { onEditTouchUp?() } diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.xib b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.xib index 50793f0a33e..a3f78690824 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.xib +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.xib @@ -26,7 +26,7 @@ -