Skip to content

Commit cb046b0

Browse files
committed
use dynamicTypeSize in hardwareview
1 parent 50f1085 commit cb046b0

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import SwiftUI
22

33
struct PointOfSaleSettingsHardwareDetailView: View {
4+
@Environment(\.dynamicTypeSize) private var dynamicTypeSize
5+
46
let settingsController: PointOfSaleSettingsControllerProtocol
57

68
@State private var navigationPath: [NavigationDestination] = []
@@ -36,16 +38,21 @@ struct PointOfSaleSettingsHardwareDetailView: View {
3638

3739
List(HardwareDestination.allCases) { destination in
3840
NavigationLink(value: NavigationDestination.hardware(destination)) {
39-
HStack(alignment: .firstTextBaseline) {
41+
DynamicHStack(horizontalAlignment: .leading, spacing: POSSpacing.medium) {
4042
Image(systemName: destination.icon)
4143
.font(.posBodyLargeRegular())
44+
.renderedIf(!dynamicTypeSize.isAccessibilitySize)
45+
4246
VStack(alignment: .leading, spacing: POSPadding.xSmall) {
4347
Text(destination.title)
4448
.font(.posBodyLargeRegular())
49+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
4550
Text(destination.subtitle)
4651
.font(.posBodyMediumRegular())
4752
.foregroundStyle(.secondary)
53+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
4854
}
55+
Spacer()
4956
}
5057
}
5158
.listRowSeparator(.hidden)
@@ -109,16 +116,21 @@ struct PointOfSaleSettingsHardwareDetailView: View {
109116
Button {
110117
showCardReaderDocumentationModal = true
111118
} label: {
112-
HStack(alignment: .firstTextBaseline) {
119+
DynamicHStack(horizontalAlignment: .leading, spacing: POSSpacing.medium) {
113120
Image(systemName: "doc.text")
114121
.font(.posBodyLargeRegular())
122+
.renderedIf(!dynamicTypeSize.isAccessibilitySize)
123+
115124
VStack(alignment: .leading, spacing: POSPadding.xSmall) {
116125
Text(Localization.cardReaderDocumentationTitle)
117126
.font(.posBodyLargeRegular())
127+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
118128
Text(Localization.cardReaderDocumentationSubtitle)
119129
.font(.posBodyMediumRegular())
120130
.foregroundStyle(.secondary)
131+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
121132
}
133+
Spacer()
122134
}
123135
}
124136
.buttonStyle(.plain)
@@ -157,16 +169,21 @@ struct PointOfSaleSettingsHardwareDetailView: View {
157169
Button {
158170
handleScannerDestination(destination)
159171
} label: {
160-
HStack(alignment: .firstTextBaseline) {
172+
DynamicHStack(horizontalAlignment: .leading, spacing: POSSpacing.medium) {
161173
Image(systemName: destination.icon)
162174
.font(.posBodyLargeRegular())
175+
.renderedIf(!dynamicTypeSize.isAccessibilitySize)
176+
163177
VStack(alignment: .leading, spacing: POSPadding.xSmall) {
164178
Text(destination.title)
165179
.font(.posBodyLargeRegular())
180+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
166181
Text(destination.subtitle)
167182
.font(.posBodyMediumRegular())
168183
.foregroundStyle(.secondary)
184+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
169185
}
186+
Spacer()
170187
}
171188
}
172189
.buttonStyle(.plain)

0 commit comments

Comments
 (0)