Skip to content

Commit c8e80f3

Browse files
committed
Limit growth of Cart back button so it wouldn't break into multiple lines
1 parent c55cf58 commit c8e80f3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

WooCommerce/Classes/POS/Presentation/CartView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ struct CartView: View {
2727
HStack {
2828
Text(Localization.cartTitle)
2929
.font(Constants.primaryFont)
30+
.lineLimit(1)
31+
.minimumScaleFactor(0.5)
32+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
3033
.foregroundColor(.posOnSurface)
3134
.accessibilityAddTraits(.isHeader)
3235

@@ -35,6 +38,9 @@ struct CartView: View {
3538
if let itemsInCartLabel = viewHelper.itemsInCartLabel(for: posModel.cart.count) {
3639
Text(itemsInCartLabel)
3740
.font(Constants.itemsFont)
41+
.lineLimit(1)
42+
.minimumScaleFactor(0.5)
43+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
3844
.foregroundColor(Color.posOnSurfaceVariantLowest)
3945
}
4046
}
@@ -258,7 +264,8 @@ private extension CartView {
258264
posModel.addMoreToCart()
259265
} label: {
260266
Image(systemName: Constants.backButtonSymbol)
261-
.font(.posBodyLargeBold, maximumContentSizeCategory: .accessibilityLarge)
267+
.font(.posBodyLargeBold)
268+
.dynamicTypeSize(...DynamicTypeSize.accessibility2)
262269
.foregroundColor(.posOnSurface)
263270
}
264271
}

0 commit comments

Comments
 (0)