From d40cb22ff4778e347a5d316b708e70db065325a9 Mon Sep 17 00:00:00 2001 From: kirukib Date: Mon, 10 Aug 2026 14:53:34 +0300 Subject: [PATCH] Finalize profile, prescription, and checkout with shared UI modules. Add payment/notification prefs, assisted pharmacist codes, Rx status journey, and mock payment intents so demo flows match the storefront brief. Co-authored-by: Cursor --- app/(root)/(screens)/checkout-success.tsx | 59 +++ app/(root)/(screens)/checkout.tsx | 444 +++++++++--------- app/(root)/(screens)/notification-prefs.tsx | 82 ++++ app/(root)/(screens)/payment-methods.tsx | 58 +++ app/(root)/(screens)/prescription/[id].tsx | 169 ++++--- app/(root)/(screens)/prescription/review.tsx | 133 ++++-- app/(root)/(screens)/profile.tsx | 55 ++- app/(root)/(tabs)/prescriptions.tsx | 260 +++------- components/care/EscalationBanner.tsx | 36 ++ components/care/FamilyInviteCard.tsx | 67 +++ components/care/index.ts | 2 + .../checkout/AssistedOrderExplainer.tsx | 20 + components/checkout/EntitlementSplitCard.tsx | 31 ++ components/checkout/LoyaltyRedeemRow.tsx | 84 ++++ components/checkout/PaymentMethodList.tsx | 66 +++ components/checkout/RxCartGate.tsx | 41 ++ components/checkout/index.ts | 5 + components/prescription/RxCareCard.tsx | 144 ++++++ components/prescription/RxImagePager.tsx | 60 +++ components/prescription/RxMedicineLines.tsx | 57 +++ components/prescription/RxQueriedPanel.tsx | 64 +++ components/prescription/RxStatusStepper.tsx | 112 +++++ components/prescription/index.ts | 5 + components/profile/BiometricRow.tsx | 49 ++ components/profile/LoyaltyStrip.tsx | 66 +++ components/profile/QuickActions.tsx | 60 +++ components/profile/index.ts | 3 + docs/BACKEND_SPEC.md | 11 +- lib/api/client.ts | 47 +- lib/data/seed.ts | 20 + lib/routes.ts | 4 + lib/stores/locationStore.ts | 30 +- lib/stores/prefsStore.ts | 40 ++ lib/stores/prescriptionStore.ts | 32 +- locales/am/common.json | 6 + locales/en/common.json | 6 + 36 files changed, 1884 insertions(+), 544 deletions(-) create mode 100644 app/(root)/(screens)/checkout-success.tsx create mode 100644 app/(root)/(screens)/notification-prefs.tsx create mode 100644 app/(root)/(screens)/payment-methods.tsx create mode 100644 components/care/EscalationBanner.tsx create mode 100644 components/care/FamilyInviteCard.tsx create mode 100644 components/care/index.ts create mode 100644 components/checkout/AssistedOrderExplainer.tsx create mode 100644 components/checkout/EntitlementSplitCard.tsx create mode 100644 components/checkout/LoyaltyRedeemRow.tsx create mode 100644 components/checkout/PaymentMethodList.tsx create mode 100644 components/checkout/RxCartGate.tsx create mode 100644 components/checkout/index.ts create mode 100644 components/prescription/RxCareCard.tsx create mode 100644 components/prescription/RxImagePager.tsx create mode 100644 components/prescription/RxMedicineLines.tsx create mode 100644 components/prescription/RxQueriedPanel.tsx create mode 100644 components/prescription/RxStatusStepper.tsx create mode 100644 components/prescription/index.ts create mode 100644 components/profile/BiometricRow.tsx create mode 100644 components/profile/LoyaltyStrip.tsx create mode 100644 components/profile/QuickActions.tsx create mode 100644 components/profile/index.ts create mode 100644 lib/stores/prefsStore.ts diff --git a/app/(root)/(screens)/checkout-success.tsx b/app/(root)/(screens)/checkout-success.tsx new file mode 100644 index 0000000..6144fd4 --- /dev/null +++ b/app/(root)/(screens)/checkout-success.tsx @@ -0,0 +1,59 @@ +import { router, useLocalSearchParams } from "expo-router"; +import { View } from "react-native"; +import { Button } from "@/components/ui/Button"; +import { Card } from "@/components/ui/Card"; +import { AppHeader } from "@/components/ui/Header"; +import { Screen } from "@/components/ui/Screen"; +import { Text } from "@/components/ui/Text"; +import { routes } from "@/lib/routes"; +import { useOrdersStore } from "@/lib/stores/ordersStore"; +import { colors, gutter } from "@/lib/theme"; +import { formatETB } from "@/lib/utils"; + +export default function CheckoutSuccessScreen() { + const params = useLocalSearchParams<{ id?: string }>(); + const id = Array.isArray(params.id) ? params.id[0] : params.id; + const order = useOrdersStore((s) => s.orders.find((o) => o.id === id)); + + return ( + + + + + Thank you + + {order + ? `Order ${order.id.slice(-8).toUpperCase()} · ${formatETB(order.selfPay ?? order.total)}` + : "Your order was placed successfully."} + + {order?.pickupCode ? ( + + Code {order.pickupCode} + + ) : null} + +