Skip to content

Commit

Permalink
Month count selector ts refactor (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jod929 authored Aug 22, 2023
1 parent ec24d0e commit 108c0a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<CalendarIcon
style={{ width: 13, height: 13, color, marginRight: 5 }}
Expand All @@ -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 one
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/1565.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [Jod929]
---

Refactor MonthCountSelector to tsx.

0 comments on commit 108c0a6

Please sign in to comment.