From 2e3ed491c0826604e1b585fb2753db133a263fdb Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Sat, 7 Oct 2023 21:08:37 +0100 Subject: [PATCH] budgetsummary to typescript --- .../{BudgetSummary.js => BudgetSummary.tsx} | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) rename packages/desktop-client/src/components/modals/{BudgetSummary.js => BudgetSummary.tsx} (86%) diff --git a/packages/desktop-client/src/components/modals/BudgetSummary.js b/packages/desktop-client/src/components/modals/BudgetSummary.tsx similarity index 86% rename from packages/desktop-client/src/components/modals/BudgetSummary.js rename to packages/desktop-client/src/components/modals/BudgetSummary.tsx index d4f3a82cba6..34aa66fe137 100644 --- a/packages/desktop-client/src/components/modals/BudgetSummary.js +++ b/packages/desktop-client/src/components/modals/BudgetSummary.tsx @@ -1,9 +1,10 @@ import React from 'react'; import { rolloverBudget } from 'loot-core/src/client/queries'; -import * as monthUtils from 'loot-core/src/shared/months'; +import { format, sheetForMonth, prevMonth } from 'loot-core/src/shared/months'; import { theme, styles } from '../../style'; +import { type CommonModalProps } from '../../types/modals'; import Button from '../common/Button'; import Modal from '../common/Modal'; import Text from '../common/Text'; @@ -35,13 +36,18 @@ function ToBudget({ toBudget }) { ); } -function BudgetSummary({ month, modalProps }) { - const prevMonthName = monthUtils.format(monthUtils.prevMonth(month), 'MMM'); +type BudgetSummaryProps = { + modalProps: CommonModalProps; + month: string; +}; + +function BudgetSummary({ month, modalProps }: BudgetSummaryProps) { + const prevMonthName = format(prevMonth(month), 'MMM'); return ( - + {() => ( - +