Skip to content

Commit 692cf08

Browse files
authored
[POS Orders] Update order details POS label (#15860)
2 parents 335e348 + a43fdc5 commit 692cf08

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

WooCommerce/Classes/Extensions/UILabel+SalesChannel.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ extension UILabel {
66
func applySalesChannelStyle() {
77
applyFootnoteStyle()
88
applyLayerSettings()
9-
backgroundColor = .lightGray
10-
textColor = .black
9+
backgroundColor = Layout.salesChannelLabelBackgroundColor
10+
textColor = Layout.salesChannelLabelTextColor
1111
}
1212

1313
/// Setup: Layer
@@ -23,5 +23,7 @@ private extension UILabel {
2323
enum Layout {
2424
static let borderWidth = CGFloat(0.0)
2525
static let cornerRadius = CGFloat(4.0)
26+
static let salesChannelLabelTextColor = UIColor(color: .wooCommercePurple(.shade80))
27+
static let salesChannelLabelBackgroundColor = UIColor(color: .wooCommercePurple(.shade10))
2628
}
2729
}

WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class SummaryTableViewCell: UITableViewCell {
1414

1515
/// Shows the sales channel if appropiate, at the moment only Point of Sale
1616
///
17-
@IBOutlet private weak var salesChannelLabel: UILabel!
17+
@IBOutlet private weak var salesChannelLabel: PaddedLabel!
1818

1919
/// Label: Payment Status
2020
///
@@ -104,8 +104,7 @@ private extension SummaryTableViewCell {
104104

105105
if ServiceLocator.featureFlagService.isFeatureFlagEnabled(.pointOfSaleOrdersi1) {
106106
salesChannelLabel.isHidden = false
107-
salesChannelLabel.applyFootnoteStyle()
108-
salesChannelLabel.accessibilityIdentifier = "summary-table-view-cell-sales-channel-label"
107+
configureSalesChannelLabel()
109108
} else {
110109
salesChannelLabel.isHidden = true
111110
}
@@ -119,6 +118,13 @@ private extension SummaryTableViewCell {
119118
configureIconForVoiceOver()
120119
}
121120

121+
func configureSalesChannelLabel() {
122+
salesChannelLabel.numberOfLines = 1
123+
salesChannelLabel.textInsets = UIEdgeInsets(top: 4, left: 8, bottom: 4, right: 8)
124+
salesChannelLabel.applySalesChannelStyle()
125+
salesChannelLabel.accessibilityIdentifier = "summary-table-view-cell-sales-channel-label"
126+
}
127+
122128
@objc func editWasTapped() {
123129
onEditTouchUp?()
124130
}

WooCommerce/Classes/ViewRelated/Orders/Order Details/Order Summary Section/SummaryTableViewCell.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<nil key="textColor"/>
2727
<nil key="highlightedColor"/>
2828
</label>
29-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sales Channel" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kU8-dT-4zl" userLabel="Sales Channel Label">
29+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="255" verticalHuggingPriority="255" text="Sales Channel" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kU8-dT-4zl" userLabel="Sales Channel Label" customClass="PaddedLabel" customModule="WooCommerce" customModuleProvider="target">
3030
<rect key="frame" x="146" y="0.0" width="142" height="40"/>
3131
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
3232
<nil key="textColor"/>

0 commit comments

Comments
 (0)