diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-1-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-1-chromium-linux.png index 5574f459f07..97d5dec1aa3 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-1-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png index 996545fab4e..9d912171d47 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png index 64807bb85f5..1d67bf60131 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-3-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png index e37fc6eeda8..42dbf39a157 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-checks-that-settings-page-can-be-opened-4-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png index 5f3d2ce786f..8ecab730c23 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png differ diff --git a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png index 4b35b1090e0..ab76fcd48d9 100644 Binary files a/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png and b/packages/desktop-client/e2e/mobile.test.js-snapshots/Mobile-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png differ diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx index 3b7b4b2f096..e2e201169a7 100644 --- a/packages/desktop-client/src/components/Modals.tsx +++ b/packages/desktop-client/src/components/Modals.tsx @@ -9,7 +9,6 @@ import useCategories from '../hooks/useCategories'; import useSyncServerStatus from '../hooks/useSyncServerStatus'; import { type CommonModalProps } from '../types/modals'; -import BudgetSummary from './modals/BudgetSummary'; import CloseAccount from './modals/CloseAccount'; import ConfirmCategoryDelete from './modals/ConfirmCategoryDelete'; import CreateAccount from './modals/CreateAccount'; @@ -25,8 +24,11 @@ import LoadBackup from './modals/LoadBackup'; import ManageRulesModal from './modals/ManageRulesModal'; import MergeUnusedPayees from './modals/MergeUnusedPayees'; import PlaidExternalMsg from './modals/PlaidExternalMsg'; +import ReportBudgetSummary from './modals/ReportBudgetSummary'; +import RolloverBudgetSummary from './modals/RolloverBudgetSummary'; import SelectLinkedAccounts from './modals/SelectLinkedAccounts'; import SingleInput from './modals/SingleInput'; +import SwitchBudgetType from './modals/SwitchBudgetType'; import DiscoverSchedules from './schedules/DiscoverSchedules'; import ScheduleDetails from './schedules/EditSchedule'; import ScheduleLink from './schedules/LinkSchedule'; @@ -247,9 +249,19 @@ export default function Modals() { /> ); - case 'budget-summary': + case 'rollover-budget-summary': return ( - + ); + + case 'report-budget-summary': + return ( + ); + case 'switch-budget-type': + return ( + + ); + default: console.error('Unknown modal:', name); return null; diff --git a/packages/desktop-client/src/components/Page.tsx b/packages/desktop-client/src/components/Page.tsx index 77d27bbba75..6f666400f7d 100644 --- a/packages/desktop-client/src/components/Page.tsx +++ b/packages/desktop-client/src/components/Page.tsx @@ -6,13 +6,21 @@ import { theme, styles, type CSSProperties } from '../style'; import Text from './common/Text'; import View from './common/View'; -function PageTitle({ - name, - style, -}: { +type PageHeaderProps = { name: ReactNode; style?: CSSProperties; -}) { + leftContent?: ReactNode; + rightContent?: ReactNode; +}; + +const HEADER_HEIGHT = 50; + +function PageHeader({ + name, + style, + leftContent, + rightContent, +}: PageHeaderProps) { const { isNarrowWidth } = useResponsive(); if (isNarrowWidth) { @@ -23,16 +31,42 @@ function PageTitle({ backgroundColor: theme.mobilePageBackground, color: theme.mobileModalText, flexDirection: 'row', - flex: '1 0 auto', - fontSize: 18, - fontWeight: 500, - height: 50, - justifyContent: 'center', - overflowY: 'auto', + flexShrink: 0, + height: HEADER_HEIGHT, ...style, }} > - {name} + + {leftContent} + + + {name} + + + {rightContent} + ); } @@ -51,25 +85,33 @@ function PageTitle({ ); } +type PageProps = { + title: ReactNode; + titleStyle?: CSSProperties; + headerLeftContent?: ReactNode; + headerRightContent?: ReactNode; + children: ReactNode; +}; + export function Page({ title, - children, titleStyle, -}: { - title: ReactNode; - children: ReactNode; - titleStyle?: CSSProperties; -}) { + headerLeftContent, + headerRightContent, + children, +}: PageProps) { let { isNarrowWidth } = useResponsive(); let HORIZONTAL_PADDING = isNarrowWidth ? 10 : 20; return ( - - - - - - - - {account.name} - - - - - - - - - + - {budget && ( + {budgeted && ( - {budget && ( + {budgeted && ( - + {/* + /> */} )} @@ -1350,7 +1441,7 @@ function IncomeGroup({ ); })} @@ -1448,6 +1543,7 @@ function BudgetGroups({ return ( )} @@ -1526,11 +1626,13 @@ export function BudgetTable(props) { onEditMode, onReorderCategory, onReorderGroup, - onShowBudgetDetails, + onShowBudgetSummary, // onOpenActionSheet, onBudgetAction, onRefresh, + onSwitchBudgetType, savePrefs, + pushModal, } = props; const GROUP_EDIT_ACTION = 'group'; @@ -1627,6 +1729,8 @@ export function BudgetTable(props) { onNextMonth={onNextMonth} showHiddenCategories={showHiddenCategories} savePrefs={savePrefs} + pushModal={pushModal} + onSwitchBudgetType={onSwitchBudgetType} /> {type === 'report' ? ( - = currentMonth} /> + = currentMonth} + onClick={onShowBudgetSummary} + /> ) : ( )} @@ -1676,7 +1783,11 @@ export function BudgetTable(props) { style={{ color: theme.buttonNormalText }} />