Skip to content

Commit 41779c7

Browse files
committed
background consistency dark mode
1 parent 1895beb commit 41779c7

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

WooCommerce/Classes/POS/Presentation/Settings/PointOfSaleSettingsHardwareDetailView.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ struct PointOfSaleSettingsHardwareDetailView: View {
2525
}
2626
}
2727

28+
private var backgroundColor: Color {
29+
Color.posOnSecondaryContainer
30+
}
31+
2832
var body: some View {
2933
NavigationStack(path: $navigationPath) {
3034
POSPageHeaderView(title: Localization.hardwareTitle)
@@ -48,7 +52,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
4852
}
4953
.listStyle(.plain)
5054
.scrollContentBackground(.hidden)
51-
.background(Color.posOnPrimaryContainer)
55+
.background(backgroundColor)
5256
.listRowBackground(Color.clear)
5357
.listRowSeparator(.hidden)
5458
.navigationDestination(for: NavigationDestination.self) { destination in
@@ -123,7 +127,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
123127
.listStyle(.plain)
124128
.scrollContentBackground(.hidden)
125129
.listRowBackground(Color.clear)
126-
.background(Color.posSurfaceBright)
130+
.background(backgroundColor)
127131
.foregroundColor(.posOnSurface)
128132
}
129133
.navigationBarBackButtonHidden(true)
@@ -142,6 +146,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
142146
}
143147
}
144148
}
149+
.toolbarBackground(backgroundColor, for: .navigationBar)
145150
.posFullScreenCover(isPresented: $showCardReaderDocumentationModal) {
146151
SafariView(url: WooConstants.URLs.inPersonPaymentsLearnMoreWCPay.asURL())
147152
}
@@ -170,7 +175,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
170175
.listStyle(.plain)
171176
.scrollContentBackground(.hidden)
172177
.listRowBackground(Color.clear)
173-
.background(Color.posSurfaceBright)
178+
.background(backgroundColor)
174179
.foregroundColor(.posOnSurface)
175180
.navigationBarBackButtonHidden(true)
176181
.toolbar {
@@ -188,6 +193,7 @@ struct PointOfSaleSettingsHardwareDetailView: View {
188193
}
189194
}
190195
}
196+
.toolbarBackground(backgroundColor, for: .navigationBar)
191197
}
192198

193199
}

WooCommerce/Classes/POS/Presentation/Settings/PointOfSaleSettingsStoreDetailView.swift

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ struct PointOfSaleSettingsStoreDetailView: View {
99
self.viewModel = viewModel
1010
}
1111

12+
private var backgroundColor: Color {
13+
Color.posOnSecondaryContainer
14+
}
15+
1216
var body: some View {
1317
NavigationStack {
1418
List {
@@ -31,10 +35,17 @@ struct PointOfSaleSettingsStoreDetailView: View {
3135
}
3236
.listRowSeparator(.hidden)
3337
} header: {
34-
Text(Localization.storeInformation)
35-
.font(.posHeadingBold)
36-
.foregroundStyle(.primary)
37-
.textCase(nil)
38+
ZStack {
39+
backgroundColor
40+
Text(Localization.storeInformation)
41+
.font(.posHeadingBold)
42+
.foregroundColor(.posOnSurface)
43+
.frame(maxWidth: .infinity, alignment: .leading)
44+
.padding(.horizontal, POSPadding.medium)
45+
.padding(.vertical, POSPadding.small)
46+
.textCase(nil)
47+
}
48+
.listRowInsets(EdgeInsets())
3849
}
3950

4051
Section {
@@ -73,16 +84,23 @@ struct PointOfSaleSettingsStoreDetailView: View {
7384
}
7485
.listRowSeparator(.hidden)
7586
} header: {
76-
Text(Localization.receiptInformation)
77-
.font(.posHeadingBold)
78-
.foregroundStyle(.primary)
79-
.textCase(nil)
87+
ZStack {
88+
backgroundColor
89+
Text(Localization.receiptInformation)
90+
.font(.posHeadingBold)
91+
.foregroundColor(.posOnSurface)
92+
.frame(maxWidth: .infinity, alignment: .leading)
93+
.padding(.horizontal, POSPadding.medium)
94+
.padding(.vertical, POSPadding.small)
95+
.textCase(nil)
96+
}
97+
.listRowInsets(EdgeInsets())
8098
}
8199
.renderedIf(viewModel.shouldShowReceiptInformation)
82100
}
83101
.listStyle(.plain)
84102
.scrollContentBackground(.hidden)
85-
.background(Color.posOnPrimaryContainer)
103+
.background(backgroundColor)
86104
.listRowSeparator(.hidden)
87105
.listSectionSeparator(.hidden)
88106
.task {

0 commit comments

Comments
 (0)