floating cart bar: coupon price row and checkout hint layout

- the coupon price gets its own row under the delivery-slot row instead of
  stacking under the line total
- "Apply Coupons at checkout" sits on the subtotal row, beside the amount
This commit is contained in:
shafi54 2026-11-16 15:56:58 +05:30
parent 9daf724075
commit d528d164b4
3 changed files with 45 additions and 30 deletions

View file

@ -1270,8 +1270,8 @@ Covered by HOME-81..98, plus:
| FCB-03 | edge | flash cart | pink theme | | FCB-03 | edge | flash cart | pink theme |
| FCB-04 | edge | cart refetch after mutation | quantities state resets | | FCB-04 | edge | cart refetch after mutation | quantities state resets |
| FCB-05 | edge | no cart data | no crash | | FCB-05 | edge | no cart data | no crash |
| FCB-06 | happy | expanded sheet | “Apply Coupons at checkout” under the subtotal | | FCB-06 | happy | expanded sheet | “Apply Coupons at checkout” on the subtotal row, beside the amount |
| FCB-07 | happy | coupon offer on the line's sku | `₹390` (₹430 line after the cap) + “With Coupon” | | FCB-07 | happy | coupon offer on the line's sku | `₹390` (₹430 line after the cap) + “With Coupon”, on its own row under the slot row |
| FCB-08 | edge | no offer for the sku | no coupon line | | FCB-08 | edge | no offer for the sku | no coupon line |
### CouponBreakdownDialog ### CouponBreakdownDialog

View file

@ -383,26 +383,24 @@ const FloatingCartBar: React.FC<FloatingCartBarProps> = ({
)} )}
/> />
)} )}
<View style={tw`items-end`}> <MyText style={tw`text-slate-900 text-sm font-bold`}>
<MyText style={tw`text-slate-900 text-sm font-bold`}> ₹{(() => {
₹{(() => { const product = productsById[item.skuId];
const product = productsById[item.skuId]; const basePrice = product?.price ?? 0;
const basePrice = product?.price ?? 0; const price = isFlashDelivery ? (product?.flashPrice ?? basePrice) : basePrice;
const price = isFlashDelivery ? (product?.flashPrice ?? basePrice) : basePrice; return price * item.quantity;
return price * item.quantity; })()}
})()} </MyText>
</MyText>
{couponLine != null && (
<View
testID={`cart-item-coupon-price-${item.id}`}
style={tw`flex-row items-center mt-0.5`}
>
<MyText style={tw`text-emerald-600 text-xs font-bold`}>₹{couponLine}</MyText>
<MyText style={tw`text-gray-400 text-[9px] ml-1`}>With Coupon</MyText>
</View>
)}
</View>
</View> </View>
{couponLine != null && (
<View
testID={`cart-item-coupon-price-${item.id}`}
style={tw`flex-row items-center mt-1.5`}
>
<MyText style={tw`text-emerald-600 text-xs font-bold`}>₹{couponLine}</MyText>
<MyText style={tw`text-gray-400 text-[9px] ml-1`}>With Coupon</MyText>
</View>
)}
</View> </View>
</View> </View>
@ -421,7 +419,17 @@ const FloatingCartBar: React.FC<FloatingCartBarProps> = ({
<View style={tw`flex-row justify-between items-center mb-5`}> <View style={tw`flex-row justify-between items-center mb-5`}>
<View> <View>
<MyText style={tw`text-slate-400 text-[10px] font-black uppercase tracking-widest`}>Subtotal</MyText> <MyText style={tw`text-slate-400 text-[10px] font-black uppercase tracking-widest`}>Subtotal</MyText>
<MyText style={tw`text-2xl font-black text-slate-900`}>₹{totalCartValue}</MyText> <View style={tw`flex-row items-baseline`}>
<MyText style={tw`text-2xl font-black text-slate-900`}>₹{totalCartValue}</MyText>
{/* The cart screens have no coupon picker; checkout does. */}
<MyText
testID="apply-coupons-hint"
numberOfLines={1}
style={tw`ml-2 text-[10px] font-bold text-slate-400 flex-shrink`}
>
Apply Coupons at checkout
</MyText>
</View>
</View> </View>
{remainingForFreeDelivery === 0 && ( {remainingForFreeDelivery === 0 && (
<View style={tw`bg-emerald-50 px-3 py-1.5 rounded-xl border border-emerald-100 flex-row items-center`}> <View style={tw`bg-emerald-50 px-3 py-1.5 rounded-xl border border-emerald-100 flex-row items-center`}>
@ -431,14 +439,6 @@ const FloatingCartBar: React.FC<FloatingCartBarProps> = ({
)} )}
</View> </View>
{/* The cart screens have no coupon picker; checkout does. */}
<MyText
testID="apply-coupons-hint"
style={tw`text-[10px] font-bold uppercase tracking-widest text-slate-400 mb-4`}
>
Apply Coupons at checkout
</MyText>
<MyTouchableOpacity <MyTouchableOpacity
onPress={() => router.push( onPress={() => router.push(
isFlashDelivery isFlashDelivery

View file

@ -1493,3 +1493,18 @@ text-base for the same reason.
PCARD-03/04 now assert sizes + colours instead of the demotion PCARD-03/04 now assert sizes + colours instead of the demotion
--- apps/user-ui/tests/pages/product-detail.test.tsx --- apps/user-ui/tests/pages/product-detail.test.tsx
PD-52 also pins the coupon size against the 3xl listed price PD-52 also pins the coupon size against the 3xl listed price
[2026-11-16 15:53:07 IST] floating cart bar layout: coupon price gets its own row, the
checkout hint sits beside the subtotal.
The coupon line was stacked under the line total, squeezing the price column. It
now spans the line below the delivery-slot row. The "Apply Coupons at checkout"
hint moves from its own block into the subtotal row, next to the amount (mixed
case and smaller so it fits beside the 2xl figure).
--- apps/user-ui/components/floating-cart-bar.tsx
- line total: back to a plain ₹total, no stacked column
+ coupon row: full-width under the slot dropdown row, ₹couponLine + "With Coupon"
(testID cart-item-coupon-price-{id})
- footer: standalone hint block under the subtotal row
+ hint inline with ₹subtotal (testID apply-coupons-hint, numberOfLines 1)