A local-first personal finance app
Month count selector ts refactor (#1565)
Joshua Krebs108c0a6176b6
diff --git a/packages/desktop-client/src/components/budget/MonthCountSelector.js b/packages/desktop-client/src/components/budget/MonthCountSelector.tsxsimilarity index 78%rename from packages/desktop-client/src/components/budget/MonthCountSelector.jsrename to packages/desktop-client/src/components/budget/MonthCountSelector.tsxindex d34dbf7a7f..d5bba0f3a2 100644--- a/packages/desktop-client/src/components/budget/MonthCountSelector.js+++ b/packages/desktop-client/src/components/budget/MonthCountSelector.tsx@@ -6,7 +6,12 @@ import View from '../common/View';import { useBudgetMonthCount } from './BudgetMonthCountContext';-function Calendar({ color, onClick }) {+type CalendarProps = {+ color: string;+ onClick: () => void;+};++function Calendar({ color, onClick }: CalendarProps) {return (<CalendarIconstyle={{ width: 13, height: 13, color, marginRight: 5 }}@@ -15,7 +20,15 @@ function Calendar({ color, onClick }) {);}-export function MonthCountSelector({ maxMonths, onChange }) {+type MonthCountSelectorProps = {+ maxMonths: number;+ onChange: (value: number) => Promise<void>;+};++export function MonthCountSelector({+ maxMonths,+ onChange,+}: MonthCountSelectorProps) {let { displayMax } = useBudgetMonthCount();// It doesn't make sense to show anything if we can only fit onediff --git a/upcoming-release-notes/1565.md b/upcoming-release-notes/1565.mdnew file mode 100644index 0000000000..4e4b62baf8--- /dev/null+++ b/upcoming-release-notes/1565.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [Jod929]+---++Refactor MonthCountSelector to tsx.\ No newline at end of file