From 024bb062050d0f2084de3684db7931cca4722091 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 24 Mar 2026 13:09:53 +0800 Subject: [PATCH] fix: SlideToConfirm gesture blocked by modal backdrop - restructure all payment modals --- app/(app)/clients/[id].tsx | 11 ++++++----- app/(app)/dashboard.tsx | 7 +++++-- app/(app)/payments/index.tsx | 11 ++++++----- components/SlideToConfirm.tsx | 6 ++++-- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/(app)/clients/[id].tsx b/app/(app)/clients/[id].tsx index 065e767..e3439ea 100644 --- a/app/(app)/clients/[id].tsx +++ b/app/(app)/clients/[id].tsx @@ -68,9 +68,10 @@ function PayInvoiceModal({ invoice, onClose, onSuccess }: { invoice: any; onClos return ( - - - + + + + Record Payment {invoice.invoiceNumber} · Balance: ₱{Number(invoice.balance).toLocaleString()} @@ -113,9 +114,9 @@ function PayInvoiceModal({ invoice, onClose, onSuccess }: { invoice: any; onClos onConfirm={submit} disabled={loading || !amount || Number(amount) <= 0} /> - - + + ); } diff --git a/app/(app)/dashboard.tsx b/app/(app)/dashboard.tsx index f2fb9fc..fd520af 100644 --- a/app/(app)/dashboard.tsx +++ b/app/(app)/dashboard.tsx @@ -289,8 +289,10 @@ export default function DashboardScreen() { {/* ── Payment Modal ──────────────────────────────────────────────────── */} - - + + {/* Tap outside to dismiss — only on the dark area above the sheet */} + + {/* Handle */} @@ -341,6 +343,7 @@ export default function DashboardScreen() { /> + ); diff --git a/app/(app)/payments/index.tsx b/app/(app)/payments/index.tsx index f94ac4e..0a65c94 100644 --- a/app/(app)/payments/index.tsx +++ b/app/(app)/payments/index.tsx @@ -41,9 +41,10 @@ function PayInvoiceModal({ invoice, onClose, onSuccess }: { invoice: any; onClos return ( - - - + + + + Record Payment {invoice.client?.firstName} {invoice.client?.lastName} · {invoice.client?.accountNumber} @@ -82,9 +83,9 @@ function PayInvoiceModal({ invoice, onClose, onSuccess }: { invoice: any; onClos onConfirm={submit} disabled={loading || !amount || Number(amount) <= 0} /> - - + + ); } diff --git a/components/SlideToConfirm.tsx b/components/SlideToConfirm.tsx index 9aa496d..e2015a9 100644 --- a/components/SlideToConfirm.tsx +++ b/components/SlideToConfirm.tsx @@ -22,8 +22,10 @@ export function SlideToConfirm({ label = 'Slide to confirm', color = '#059669', const panResponder = useRef( PanResponder.create({ - onStartShouldSetPanResponder: () => !disabled && !done, - onMoveShouldSetPanResponder: () => !disabled && !done, + onStartShouldSetPanResponder: () => !disabled && !done, + onStartShouldSetPanResponderCapture: () => !disabled && !done, + onMoveShouldSetPanResponder: () => !disabled && !done, + onMoveShouldSetPanResponderCapture: () => !disabled && !done, onPanResponderMove: (_, gs) => { const x = Math.max(0, Math.min(gs.dx, maxX)); pan.setValue(x);