diff --git a/frontend/src/pages/budgets/BudgetsPage.tsx b/frontend/src/pages/budgets/BudgetsPage.tsx index d4bb354..0b51142 100644 --- a/frontend/src/pages/budgets/BudgetsPage.tsx +++ b/frontend/src/pages/budgets/BudgetsPage.tsx @@ -8,6 +8,7 @@ import { IconDeviceFloppy, IconUpload, IconDownload, IconInfoCircle } from '@tab import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import api from '../../services/api'; import { useIsReadOnly } from '../../stores/authStore'; +import { usePreferencesStore } from '../../stores/preferencesStore'; interface BudgetLine { account_id: string; @@ -98,6 +99,11 @@ export function BudgetsPage() { const queryClient = useQueryClient(); const fileInputRef = useRef(null); const isReadOnly = useIsReadOnly(); + const isDark = usePreferencesStore((s) => s.colorScheme) === 'dark'; + const stickyBg = isDark ? 'var(--mantine-color-dark-7)' : 'white'; + const stickyBorder = isDark ? 'var(--mantine-color-dark-4)' : '#e9ecef'; + const incomeSectionBg = isDark ? 'var(--mantine-color-green-9)' : '#e6f9e6'; + const expenseSectionBg = isDark ? 'var(--mantine-color-red-9)' : '#fde8e8'; const { isLoading } = useQuery({ queryKey: ['budgets', year], @@ -317,8 +323,8 @@ export function BudgetsPage() { - Acct # - Account Name + Acct # + Account Name {monthLabels.map((m) => ( {m} ))} @@ -337,7 +343,7 @@ export function BudgetsPage() { const lines = budgetData.filter((b) => b.account_type === type); if (lines.length === 0) return null; - const sectionBg = type === 'income' ? '#e6f9e6' : '#fde8e8'; + const sectionBg = type === 'income' ? incomeSectionBg : expenseSectionBg; const sectionTotal = lines.reduce((sum, line) => sum + (line.annual_total || 0), 0); return [ @@ -368,9 +374,9 @@ export function BudgetsPage() { style={{ position: 'sticky', left: 0, - background: 'white', + background: stickyBg, zIndex: 1, - borderRight: '1px solid #e9ecef', + borderRight: `1px solid ${stickyBorder}`, }} > {line.account_number} @@ -379,9 +385,9 @@ export function BudgetsPage() { style={{ position: 'sticky', left: 120, - background: 'white', + background: stickyBg, zIndex: 1, - borderRight: '1px solid #e9ecef', + borderRight: `1px solid ${stickyBorder}`, }} > diff --git a/frontend/src/pages/cash-flow/CashFlowForecastPage.tsx b/frontend/src/pages/cash-flow/CashFlowForecastPage.tsx index fa70ebf..0f2be49 100644 --- a/frontend/src/pages/cash-flow/CashFlowForecastPage.tsx +++ b/frontend/src/pages/cash-flow/CashFlowForecastPage.tsx @@ -8,6 +8,7 @@ import { IconArrowLeft, IconArrowRight, IconCalendar, } from '@tabler/icons-react'; import { useQuery } from '@tanstack/react-query'; +import { usePreferencesStore } from '../../stores/preferencesStore'; import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip as RechartsTooltip, ResponsiveContainer, Legend, @@ -79,6 +80,7 @@ export function CashFlowForecastPage() { const now = new Date(); const currentYear = now.getFullYear(); const currentMonth = now.getMonth() + 1; + const isDark = usePreferencesStore((s) => s.colorScheme) === 'dark'; // Filter: All, Operating, Reserve const [fundFilter, setFundFilter] = useState('all'); @@ -418,10 +420,10 @@ export function CashFlowForecastPage() { diff --git a/frontend/src/pages/monthly-actuals/MonthlyActualsPage.tsx b/frontend/src/pages/monthly-actuals/MonthlyActualsPage.tsx index e01b319..f9e0e28 100644 --- a/frontend/src/pages/monthly-actuals/MonthlyActualsPage.tsx +++ b/frontend/src/pages/monthly-actuals/MonthlyActualsPage.tsx @@ -10,6 +10,7 @@ import { import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import api from '../../services/api'; import { useIsReadOnly } from '../../stores/authStore'; +import { usePreferencesStore } from '../../stores/preferencesStore'; import { AttachmentPanel } from '../../components/attachments/AttachmentPanel'; interface ActualLine { @@ -66,6 +67,11 @@ export function MonthlyActualsPage() { const [savedJEId, setSavedJEId] = useState(null); const queryClient = useQueryClient(); const isReadOnly = useIsReadOnly(); + const isDark = usePreferencesStore((s) => s.colorScheme) === 'dark'; + const stickyBg = isDark ? 'var(--mantine-color-dark-7)' : 'white'; + const stickyBorder = isDark ? 'var(--mantine-color-dark-4)' : '#e9ecef'; + const incomeBg = isDark ? 'var(--mantine-color-green-9)' : '#e6f9e6'; + const expenseBg = isDark ? 'var(--mantine-color-red-9)' : '#fde8e8'; const yearOptions = Array.from({ length: 5 }, (_, i) => { const y = new Date().getFullYear() - 2 + i; @@ -178,16 +184,16 @@ export function MonthlyActualsPage() { {line.account_number} @@ -292,10 +298,10 @@ export function MonthlyActualsPage() {
{d.month}
- + Acct # - + Account Name Budget @@ -304,8 +310,8 @@ export function MonthlyActualsPage() { - {renderSection('Income', incomeLines, '#e6f9e6', totals.incomeBudget, totals.incomeActual)} - {renderSection('Expenses', expenseLines, '#fde8e8', totals.expenseBudget, totals.expenseActual)} + {renderSection('Income', incomeLines, incomeBg, totals.incomeBudget, totals.incomeActual)} + {renderSection('Expenses', expenseLines, expenseBg, totals.expenseBudget, totals.expenseActual)}
diff --git a/frontend/src/pages/reports/BudgetVsActualPage.tsx b/frontend/src/pages/reports/BudgetVsActualPage.tsx index 6e36a6d..d2dc7c9 100644 --- a/frontend/src/pages/reports/BudgetVsActualPage.tsx +++ b/frontend/src/pages/reports/BudgetVsActualPage.tsx @@ -5,6 +5,7 @@ import { } from '@mantine/core'; import { useQuery } from '@tanstack/react-query'; import api from '../../services/api'; +import { usePreferencesStore } from '../../stores/preferencesStore'; interface BudgetVsActualLine { account_id: string; @@ -46,6 +47,9 @@ const monthFilterOptions = [ export function BudgetVsActualPage() { const [year, setYear] = useState(new Date().getFullYear().toString()); const [month, setMonth] = useState(''); + const isDark = usePreferencesStore((s) => s.colorScheme) === 'dark'; + const incomeBg = isDark ? 'var(--mantine-color-green-9)' : '#e6f9e6'; + const expenseBg = isDark ? 'var(--mantine-color-red-9)' : '#fde8e8'; const yearOptions = Array.from({ length: 5 }, (_, i) => { const y = new Date().getFullYear() - 2 + i; @@ -92,7 +96,7 @@ export function BudgetVsActualPage() { const renderSection = (title: string, sectionLines: BudgetVsActualLine[], isExpense: boolean, totalBudget: number, totalActual: number) => ( <> - + {title} {sectionLines.map((line) => { diff --git a/frontend/src/pages/reports/QuarterlyReportPage.tsx b/frontend/src/pages/reports/QuarterlyReportPage.tsx index 92d4af3..39db971 100644 --- a/frontend/src/pages/reports/QuarterlyReportPage.tsx +++ b/frontend/src/pages/reports/QuarterlyReportPage.tsx @@ -8,6 +8,7 @@ import { IconTrendingUp, IconTrendingDown, IconAlertTriangle, IconChartBar, } from '@tabler/icons-react'; import api from '../../services/api'; +import { usePreferencesStore } from '../../stores/preferencesStore'; interface BudgetVsActualItem { account_id: string; @@ -48,6 +49,9 @@ export function QuarterlyReportPage() { const currentQuarter = Math.ceil((now.getMonth() + 1) / 3); const defaultQuarter = currentQuarter; const defaultYear = now.getFullYear(); + const isDark = usePreferencesStore((s) => s.colorScheme) === 'dark'; + const incomeBg = isDark ? 'var(--mantine-color-green-9)' : '#e6f9e6'; + const expenseBg = isDark ? 'var(--mantine-color-red-9)' : '#fde8e8'; const [year, setYear] = useState(String(defaultYear)); const [quarter, setQuarter] = useState(String(defaultQuarter)); @@ -207,7 +211,7 @@ export function QuarterlyReportPage() { {incomeItems.length > 0 && ( - + Income )} @@ -215,7 +219,7 @@ export function QuarterlyReportPage() { ))} {incomeItems.length > 0 && ( - + Total Income {fmt(incomeItems.reduce((s, i) => s + i.quarter_budget, 0))} {fmt(incomeItems.reduce((s, i) => s + i.quarter_actual, 0))} @@ -226,7 +230,7 @@ export function QuarterlyReportPage() { )} {expenseItems.length > 0 && ( - + Expenses )} @@ -234,7 +238,7 @@ export function QuarterlyReportPage() { ))} {expenseItems.length > 0 && ( - + Total Expenses {fmt(expenseItems.reduce((s, i) => s + i.quarter_budget, 0))} {fmt(expenseItems.reduce((s, i) => s + i.quarter_actual, 0))}