Description
The mobile checkout screen has a coupon code input and an "Apply" button, but the button has no onPress handler. The coupon code is collected but never validated or applied against the API.
The storefront web version correctly calls the coupon validation API — the mobile version is missing the equivalent handler.
Files to Change
packages/mobile/app/checkout.tsx — lines 224–227
Steps
- Add an
onPress handler to the Apply Pressable component
- Call the coupon validation API endpoint (see storefront checkout for reference)
- On success, apply the discount to the order total
- On failure, show an error message to the user
- Handle loading state while validating
Reference
- Storefront coupon implementation:
packages/storefront/src/pages/Checkout.tsx
- API endpoint:
POST /api/coupons/validate
Effort
S — well-defined feature with a clear reference implementation
Description
The mobile checkout screen has a coupon code input and an "Apply" button, but the button has no
onPresshandler. The coupon code is collected but never validated or applied against the API.The storefront web version correctly calls the coupon validation API — the mobile version is missing the equivalent handler.
Files to Change
packages/mobile/app/checkout.tsx— lines 224–227Steps
onPresshandler to the ApplyPressablecomponentReference
packages/storefront/src/pages/Checkout.tsxPOST /api/coupons/validateEffort
S — well-defined feature with a clear reference implementation