A local-first personal finance app
feat: add previous/next month navigation to the MonthPicker (#4692)
Michael Süssemilcha2878ff2a208
diff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.pngindex 2b2b2f9bcd..feccc3970c 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.pngindex cbe8775ad8..2b5fc11e67 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.pngindex 090d43e805..bad7b89da5 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-1-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-1-chromium-linux.pngindex 21d5d2d7a5..22427b2890 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-1-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.pngindex 586772a0b3..b230234eb6 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png differdiff --git a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-3-chromium-linux.png b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-3-chromium-linux.pngindex ebe64cdbf5..cb5e58757b 100644Binary files a/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-3-chromium-linux.png differdiff --git a/packages/desktop-client/src/components/budget/MonthPicker.tsx b/packages/desktop-client/src/components/budget/MonthPicker.tsxindex d816541dd3..41c33482eb 100644--- a/packages/desktop-client/src/components/budget/MonthPicker.tsx+++ b/packages/desktop-client/src/components/budget/MonthPicker.tsx@@ -2,6 +2,10 @@import React, { type CSSProperties, useState } from 'react';import { useTranslation } from 'react-i18next';+import {+ SvgCheveronLeft,+ SvgCheveronRight,+} from '@actual-app/components/icons/v1';import { SvgCalendar } from '@actual-app/components/icons/v2';import { styles } from '@actual-app/components/styles';import { theme } from '@actual-app/components/theme';@@ -104,6 +108,24 @@ export const MonthPicker = ({/></View></Link>+ <Link+ variant="button"+ buttonVariant="bare"+ onPress={() => onSelect(monthUtils.prevMonth(startMonth))}+ style={{+ padding: '3px 3px',+ marginRight: '12px',+ }}+ >+ <View title={t('Previous month')}>+ <SvgCheveronLeft+ style={{+ width: 16,+ height: 16,+ }}+ />+ </View>+ </Link>{range.map((month, idx) => {const monthName = monthUtils.format(month, 'MMM', locale);const selected =@@ -213,6 +235,24 @@ export const MonthPicker = ({</View>);})}+ <Link+ variant="button"+ buttonVariant="bare"+ onPress={() => onSelect(monthUtils.nextMonth(startMonth))}+ style={{+ padding: '3px 3px',+ marginLeft: '12px',+ }}+ >+ <View title={t('Next month')}>+ <SvgCheveronRight+ style={{+ width: 16,+ height: 16,+ }}+ />+ </View>+ </Link>{/*Keep range centered*/}<spanstyle={{diff --git a/upcoming-release-notes/4692.md b/upcoming-release-notes/4692.mdnew file mode 100644index 0000000000..7cfc64e35f--- /dev/null+++ b/upcoming-release-notes/4692.md@@ -0,0 +1,6 @@+---+category: Enhancements+authors: [misu-dev]+---++Add previous/next month buttons to the MonthPicker