Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Month count selector ts refactor #1562

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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