Skip to content

Commit

Permalink
budgetsummary to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
MikesGlitch committed Oct 7, 2023
1 parent 8dddf29 commit 2e3ed49
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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 (
<Modal title="Budget Details" {...modalProps} animate>
<Modal title="Budget Details" {...modalProps}>
{() => (
<NamespaceContext.Provider value={monthUtils.sheetForMonth(month)}>
<NamespaceContext.Provider value={sheetForMonth(month)}>
<View
style={{
flexDirection: 'row',
Expand Down

0 comments on commit 2e3ed49

Please sign in to comment.