fix: sticky category column and month dropdown selector (#29) #30

Merged
maximus merged 4 commits from fix/simpl-resultat-29-budget-visual-adjustments into main 2026-03-10 01:29:28 +00:00
Showing only changes of commit 8971e443d8 - Show all commits

View file

@ -224,19 +224,6 @@ export function useReports() {
dispatch({ type: "SET_PERIOD", payload: period }); dispatch({ type: "SET_PERIOD", payload: period });
}, []); }, []);
const navigateBudgetMonth = useCallback((delta: -1 | 1) => {
let newMonth = state.budgetMonth + delta;
let newYear = state.budgetYear;
if (newMonth < 1) {
newMonth = 12;
newYear -= 1;
} else if (newMonth > 12) {
newMonth = 1;
newYear += 1;
}
dispatch({ type: "SET_BUDGET_MONTH", payload: { year: newYear, month: newMonth } });
}, [state.budgetYear, state.budgetMonth]);
const setBudgetMonth = useCallback((year: number, month: number) => { const setBudgetMonth = useCallback((year: number, month: number) => {
dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } }); dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } });
}, []); }, []);
@ -253,5 +240,5 @@ export function useReports() {
dispatch({ type: "SET_SOURCE_ID", payload: id }); dispatch({ type: "SET_SOURCE_ID", payload: id });
}, []); }, []);
return { state, setTab, setPeriod, setCustomDates, navigateBudgetMonth, setBudgetMonth, setPivotConfig, setSourceId }; return { state, setTab, setPeriod, setCustomDates, setBudgetMonth, setPivotConfig, setSourceId };
} }