From 81ae41325aeb37bc37b5b0360a010b30fd31f178 Mon Sep 17 00:00:00 2001 From: null Date: Thu, 4 Jun 2026 21:22:20 -0500 Subject: [PATCH] feat: move income modal to tracker page, clickable bank card --- client/pages/SummaryPage.jsx | 16 +--------------- client/pages/TrackerPage.jsx | 33 ++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/client/pages/SummaryPage.jsx b/client/pages/SummaryPage.jsx index c4e10df..b525743 100644 --- a/client/pages/SummaryPage.jsx +++ b/client/pages/SummaryPage.jsx @@ -21,7 +21,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com import { Input } from '@/components/ui/input'; import { cn, fmt } from '@/lib/utils'; import { moveInArray, reorderPayload } from '@/lib/reorder'; -import IncomeBreakdownModal from '@/components/IncomeBreakdownModal'; const MONTHS = [ 'January', @@ -205,7 +204,6 @@ export default function SummaryPage() { const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [error, setError] = useState(''); - const [incomeModalOpen, setIncomeModalOpen] = useState(false); const [startingFirst, setStartingFirst] = useState('0'); const [startingFifteenth, setStartingFifteenth] = useState('0'); const [startingOther, setStartingOther] = useState('0'); @@ -568,10 +566,7 @@ export default function SummaryPage() { - setIncomeModalOpen(true) : undefined} - /> + @@ -581,15 +576,6 @@ export default function SummaryPage() { )} - {data?.bank_tracking?.enabled && ( - setIncomeModalOpen(false)} - year={data.year} - month={data.month} - bankTracking={data.bank_tracking} - /> - )} ); } diff --git a/client/pages/TrackerPage.jsx b/client/pages/TrackerPage.jsx index 7bb4b69..dc210f1 100644 --- a/client/pages/TrackerPage.jsx +++ b/client/pages/TrackerPage.jsx @@ -29,6 +29,7 @@ import { FilterChip } from '@/components/tracker/FilterChip'; import { SummaryCard, TrendCard } from '@/components/tracker/SummaryCards'; import { PaymentLedgerDialog } from '@/components/tracker/PaymentLedgerDialog'; import { TrackerBucket as Bucket } from '@/components/tracker/TrackerBucket'; +import IncomeBreakdownModal from '@/components/IncomeBreakdownModal'; // ── Main page ────────────────────────────────────────────────────────────── @@ -107,6 +108,7 @@ export default function TrackerPage() { const [editBillData, setEditBillData] = useState(null); // Edit Starting Amounts modal: true when open, false when closed const [editStartingOpen, setEditStartingOpen] = useState(false); + const [incomeModalOpen, setIncomeModalOpen] = useState(false); const [orderedRows, setOrderedRows] = useState(null); const [movingBillId, setMovingBillId] = useState(null); @@ -515,12 +517,18 @@ export default function TrackerPage() { ) : (
{bankTracking?.enabled ? ( -
= 0 - ? 'border-emerald-500/30 bg-card/95' - : 'border-destructive/30 bg-card/95', - )}> + ) : ( { setEditStartingOpen(false); refetch(); }} /> + {/* Income breakdown modal — opens when clicking the bank balance card */} + {bankTracking?.enabled && ( + setIncomeModalOpen(false)} + year={year} + month={month} + bankTracking={bankTracking} + /> + )} + {/* Late-attribution dialog — fires after sync when a payment just crossed a month boundary */} {lateAttributions.length > 0 && (