Skip to content

Commit

Permalink
refactor MonthCountSelector to tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jod929 committed Aug 21, 2023
1 parent 6fae795 commit 2ed62e5
Showing 1 changed file with 15 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: () => 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

0 comments on commit 2ed62e5

Please sign in to comment.