Skip to content

Commit 7ef386e

Browse files
committed
remove using a List for hardware details card destination in favor of vstack
the list applies its own styles to the background, which isn’t needed
1 parent b73ab32 commit 7ef386e

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

Modules/Sources/PointOfSale/Presentation/Settings/POSSettingsHardwareDetailView.swift

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -143,47 +143,46 @@ private extension POSSettingsHardwareDetailView {
143143
}, buttonIcon: "chevron.left"))
144144
.foregroundColor(.posSurface)
145145

146-
List {
147-
if case .connected = posModel.cardReaderConnectionStatus {
148-
VStack(spacing: POSPadding.xSmall) {
149-
HStack {
150-
Text(Localization.readerModelTitle)
151-
.foregroundStyle(.primary)
152-
Spacer()
153-
Text(cardReaderName)
154-
.foregroundStyle(.secondary)
155-
}
156-
.padding()
157-
HStack {
158-
Text(Localization.readerBatteryTitle)
159-
.foregroundStyle(.primary)
160-
Spacer()
161-
Text(formattedBatteryLevel)
162-
.foregroundStyle(.secondary)
146+
ScrollView {
147+
VStack(spacing: POSSpacing.small) {
148+
if case .connected = posModel.cardReaderConnectionStatus {
149+
VStack(spacing: POSPadding.xSmall) {
150+
HStack {
151+
Text(Localization.readerModelTitle)
152+
.foregroundStyle(.primary)
153+
Spacer()
154+
Text(cardReaderName)
155+
.foregroundStyle(.secondary)
156+
}
157+
.padding()
158+
HStack {
159+
Text(Localization.readerBatteryTitle)
160+
.foregroundStyle(.primary)
161+
Spacer()
162+
Text(formattedBatteryLevel)
163+
.foregroundStyle(.secondary)
164+
}
165+
.padding()
163166
}
164-
.padding()
167+
.font(.posBodyMediumRegular())
168+
} else {
169+
POSSettingsCard(title: Localization.cardReaderConnectTitle,
170+
subtitle: Localization.cardReaderConnectSubtitle,
171+
action: {
172+
posModel.connectCardReader()
173+
})
165174
}
166-
.font(.posBodyMediumRegular())
167-
} else {
168-
POSSettingsCard(title: Localization.cardReaderConnectTitle,
169-
subtitle: Localization.cardReaderConnectSubtitle,
170-
action: {
171-
posModel.connectCardReader()
172-
})
173-
}
174175

175-
POSSettingsCard(title: Localization.cardReaderDocumentationTitle,
176-
subtitle: Localization.cardReaderDocumentationSubtitle,
177-
action: { showCardReaderDocumentationModal = true })
178-
.accessibilityAddTraits(.isButton)
179-
.listRowSeparator(.hidden)
176+
POSSettingsCard(title: Localization.cardReaderDocumentationTitle,
177+
subtitle: Localization.cardReaderDocumentationSubtitle,
178+
action: { showCardReaderDocumentationModal = true })
179+
.accessibilityAddTraits(.isButton)
180+
}
181+
.padding(.horizontal, POSPadding.medium)
182+
.foregroundColor(.posOnSurface)
180183
}
181-
.listStyle(.plain)
182-
.scrollContentBackground(.hidden)
183-
.listRowBackground(Color.clear)
184-
.background(backgroundColor)
185-
.foregroundColor(.posOnSurface)
186184
}
185+
.background(backgroundColor)
187186
.navigationBarBackButtonHidden(true)
188187
.posFullScreenCover(isPresented: $showCardReaderDocumentationModal) {
189188
SafariView(url: POSConstants.URLs.inPersonPaymentsLearnMoreWCPay.asURL())

0 commit comments

Comments
 (0)