Skip to content

Commit d5563c2

Browse files
committed
Add dummy coupons to CartView
1 parent 11e49a9 commit d5563c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

WooCommerce/Classes/POS/Presentation/CartView.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ struct CartView: View {
4747
ScrollViewReader { proxy in
4848
ScrollView {
4949
VStack(spacing: Constants.cartItemSpacing) {
50+
51+
/// WIP: Behind the feature flag
52+
if posModel.cart.coupons.isNotEmpty {
53+
ForEach(posModel.cart.coupons, id: \.id) { couponItem in
54+
CouponRowView(couponItem: couponItem,
55+
onItemRemoveTapped: posModel.orderStage == .building ? {
56+
posModel.remove(cartItem: couponItem)
57+
} : nil)
58+
.id(couponItem.id)
59+
.transition(.opacity)
60+
}
61+
62+
Spacer(minLength: 64)
63+
}
64+
5065
ForEach(posModel.cart.items, id: \.id) { cartItem in
5166
ItemRowView(cartItem: cartItem,
5267
showImage: $shouldShowItemImages,
@@ -59,6 +74,7 @@ struct CartView: View {
5974
}
6075
}
6176
.animation(Constants.cartAnimation, value: posModel.cart.items.map(\.id))
77+
.animation(Constants.cartAnimation, value: posModel.cart.coupons.map(\.id))
6278
.background(GeometryReader { geometry in
6379
Color.clear.preference(key: ScrollOffSetPreferenceKey.self,
6480
value: geometry.frame(in: coordinateSpace).origin.y)

0 commit comments

Comments
 (0)