Skip to content

Commit

Permalink
Mobile budget page modals
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Mar 22, 2024
1 parent 971d33c commit 9d004dd
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 220 deletions.
22 changes: 19 additions & 3 deletions packages/desktop-client/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSyncServerStatus } from '../hooks/useSyncServerStatus';

import { AccountAutocompleteModal } from './modals/AccountAutocompleteModal';
import { AccountMenuModal } from './modals/AccountMenuModal';
import { BudgetMenuModal } from './modals/BudgetMenuModal';
import { CategoryAutocompleteModal } from './modals/CategoryAutocompleteModal';
import { CategoryGroupMenuModal } from './modals/CategoryGroupMenuModal';
import { CategoryMenuModal } from './modals/CategoryMenuModal';
Expand Down Expand Up @@ -46,7 +47,7 @@ import { ScheduledTransactionMenuModal } from './modals/ScheduledTransactionMenu
import { SelectLinkedAccounts } from './modals/SelectLinkedAccounts';
import { SimpleFinInitialise } from './modals/SimpleFinInitialise';
import { SingleInputModal } from './modals/SingleInputModal';
import { SwitchBudgetType } from './modals/SwitchBudgetType';
import { SwitchBudgetTypeModal } from './modals/SwitchBudgetTypeModal';
import { TransferModal } from './modals/TransferModal';
import { DiscoverSchedules } from './schedules/DiscoverSchedules';
import { PostsOfflineNotification } from './schedules/PostsOfflineNotification';
Expand Down Expand Up @@ -400,10 +401,10 @@ export function Modals() {

case 'switch-budget-type':
return (
<SwitchBudgetType
<SwitchBudgetTypeModal
key={name}
modalProps={modalProps}
onSwitch={options?.onSwitch}
onSwitch={options.onSwitch}
/>
);

Expand Down Expand Up @@ -549,6 +550,21 @@ export function Modals() {
/>
);

case 'budget-menu':
return (
<NamespaceContext.Provider
key={name}
value={monthUtils.sheetForMonth(options.month)}
>
<BudgetMenuModal
modalProps={modalProps}
month={options.month}
onToggleHiddenCategories={options.onToggleHiddenCategories}
onSwitchBudgetType={options.onSwitchBudgetType}
/>
</NamespaceContext.Provider>
);

default:
console.error('Unknown modal:', name);
return null;
Expand Down
Loading

0 comments on commit 9d004dd

Please sign in to comment.