Skip to content

Commit 1ff933d

Browse files
authored
Merge pull request #1337 from woocommerce/issue/1332-darkmode-settings
Set background colour of cells used in Settings
2 parents 11e9167 + acba6fa commit 1ff933d

File tree

7 files changed

+90
-4
lines changed

7 files changed

+90
-4
lines changed

WooCommerce/Classes/Authentication/Epilogue/EmptyStoresTableViewCell.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,17 @@ class EmptyStoresTableViewCell: UITableViewCell {
1616
comment: "Displayed during the Login flow, whenever the user has no woo stores associated.")
1717
}
1818
}
19+
20+
override func awakeFromNib() {
21+
super.awakeFromNib()
22+
23+
configureBackground()
24+
}
25+
}
26+
27+
28+
private extension EmptyStoresTableViewCell {
29+
func configureBackground() {
30+
applyDefaultBackgroundStyle()
31+
}
1932
}

WooCommerce/Classes/Authentication/Epilogue/StoreTableViewCell.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ class StoreTableViewCell: UITableViewCell {
7373

7474
override func awakeFromNib() {
7575
super.awakeFromNib()
76-
nameLabel.textColor = StyleManager.wooSecondary
77-
urlLabel.textColor = StyleManager.wooSecondary
76+
configureBackground()
77+
configureNameLabel()
78+
configureUrlLabel()
7879
}
7980

8081
/// Displays (or hides) the Checkmark ContainerView, based on the `allowsCheckmark` property.
@@ -89,3 +90,18 @@ class StoreTableViewCell: UITableViewCell {
8990
checkmarkImageView.image = displaysCheckmark ? .checkmarkStyledImage : nil
9091
}
9192
}
93+
94+
95+
private extension StoreTableViewCell {
96+
func configureBackground() {
97+
applyDefaultBackgroundStyle()
98+
}
99+
100+
func configureNameLabel() {
101+
nameLabel.textColor = StyleManager.wooSecondary
102+
}
103+
104+
func configureUrlLabel() {
105+
urlLabel.textColor = StyleManager.wooSecondary
106+
}
107+
}

WooCommerce/Classes/ViewRelated/ReusableViews/BasicTableViewCell.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class BasicTableViewCell: UITableViewCell {
55
override func awakeFromNib() {
66
super.awakeFromNib()
77

8+
configureBackground()
89
textLabel?.applyBodyStyle()
910
}
1011

@@ -15,3 +16,10 @@ class BasicTableViewCell: UITableViewCell {
1516
textLabel?.textAlignment = .natural
1617
}
1718
}
19+
20+
21+
private extension BasicTableViewCell {
22+
func configureBackground() {
23+
applyDefaultBackgroundStyle()
24+
}
25+
}

WooCommerce/Classes/ViewRelated/ReusableViews/HeadlineLabelTableViewCell.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,23 @@ final class HeadlineLabelTableViewCell: UITableViewCell {
3232
override func awakeFromNib() {
3333
super.awakeFromNib()
3434

35+
configureBackground()
36+
configureHeadline()
37+
configureBody()
38+
}
39+
}
40+
41+
42+
private extension HeadlineLabelTableViewCell {
43+
func configureBackground() {
44+
applyDefaultBackgroundStyle()
45+
}
46+
47+
func configureHeadline() {
3548
headlineLabel?.applyHeadlineStyle()
49+
}
50+
51+
func configureBody() {
3652
bodyLabel?.applyBodyStyle()
3753
}
3854
}

WooCommerce/Classes/ViewRelated/ReusableViews/SwitchTableViewCell.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class SwitchTableViewCell: UITableViewCell {
5151
override func awakeFromNib() {
5252
super.awakeFromNib()
5353

54+
configureBackground()
5455
setupTextLabels()
5556
setupSwitch()
5657
setupGestureRecognizers()
@@ -66,6 +67,10 @@ class SwitchTableViewCell: UITableViewCell {
6667
//
6768
private extension SwitchTableViewCell {
6869

70+
func configureBackground() {
71+
applyDefaultBackgroundStyle()
72+
}
73+
6974
func setupTextLabels() {
7075
textLabel?.text = String()
7176
textLabel?.applyBodyStyle()

WooCommerce/Classes/ViewRelated/ReusableViews/TopLeftImageTableViewCell.swift

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class TopLeftImageTableViewCell: UITableViewCell {
77
override func awakeFromNib() {
88
super.awakeFromNib()
99

10-
textLabel?.applyBodyStyle()
11-
textLabel?.numberOfLines = 0
10+
configureBackground()
11+
configureTextLabel()
1212
}
1313

1414
override func layoutSubviews() {
@@ -18,6 +18,18 @@ class TopLeftImageTableViewCell: UITableViewCell {
1818
}
1919
}
2020

21+
22+
private extension TopLeftImageTableViewCell {
23+
func configureBackground() {
24+
applyDefaultBackgroundStyle()
25+
}
26+
27+
func configureTextLabel() {
28+
textLabel?.applyBodyStyle()
29+
textLabel?.numberOfLines = 0
30+
}
31+
}
32+
2133
extension TopLeftImageTableViewCell {
2234
struct Constants {
2335
static let iconW = CGFloat(24)

WooCommerce/Classes/ViewRelated/ReusableViews/ValueOneTableViewCell.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ class ValueOneTableViewCell: UITableViewCell {
55
override func awakeFromNib() {
66
super.awakeFromNib()
77

8+
configureBackground()
9+
configureTextLabel()
10+
configureDetailTextLabel()
11+
}
12+
}
13+
14+
15+
private extension ValueOneTableViewCell {
16+
func configureBackground() {
17+
applyDefaultBackgroundStyle()
18+
}
19+
20+
func configureTextLabel() {
821
textLabel?.applyBodyStyle()
22+
}
23+
24+
func configureDetailTextLabel() {
925
detailTextLabel?.applySubheadlineStyle()
1026
detailTextLabel?.lineBreakMode = .byWordWrapping
1127
detailTextLabel?.numberOfLines = 0

0 commit comments

Comments
 (0)