@@ -21,22 +21,24 @@ struct CartView: View {
2121 POSPageHeaderView ( title: Localization . cartTitle,
2222 backButtonConfiguration: backButtonConfiguration,
2323 trailingContent: {
24- if let itemsInCartLabel = viewHelper. itemsInCartLabel ( for: posModel. cart. count) {
25- Text ( itemsInCartLabel)
26- . font ( Constants . itemsFont)
27- . lineLimit ( 1 )
28- . minimumScaleFactor ( 0.5 )
29- . dynamicTypeSize ( ... DynamicTypeSize . accessibility2)
30- . foregroundColor ( Color . posOnSurfaceVariantLowest)
31- }
24+ DynamicHStack ( horizontalAlignment: . trailing, verticalAlignment: . center, spacing: Constants . cartHeaderElementSpacing) {
25+ if let itemsInCartLabel = viewHelper. itemsInCartLabel ( for: posModel. cart. count) {
26+ Text ( itemsInCartLabel)
27+ . font ( Constants . itemsFont)
28+ . lineLimit ( 1 )
29+ . minimumScaleFactor ( 0.5 )
30+ . dynamicTypeSize ( ... DynamicTypeSize . accessibility2)
31+ . foregroundColor ( Color . posOnSurfaceVariantLowest)
32+ }
3233
33- Button {
34- posModel. removeAllItemsFromCart ( )
35- } label: {
36- Text ( Localization . clearButtonTitle)
34+ Button {
35+ posModel. removeAllItemsFromCart ( )
36+ } label: {
37+ Text ( Localization . clearButtonTitle)
38+ }
39+ . buttonStyle ( POSOutlinedButtonStyle ( size: . extraSmall) )
40+ . renderedIf ( shouldShowClearCartButton)
3741 }
38- . buttonStyle ( POSOutlinedButtonStyle ( size: . extraSmall) )
39- . renderedIf ( shouldShowClearCartButton)
4042 } )
4143 . if ( shouldApplyHeaderBottomShadow, transform: { $0. applyBottomShadow ( backgroundColor: backgroundColor) } )
4244
0 commit comments