From 3bbd7539aeefba2bf09d1c9908223070490780a1 Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Sun, 3 Nov 2024 13:31:48 +0100 Subject: [PATCH] feat: now button on budget --- .../src/components/budget/MonthPicker.tsx | 21 ++++++++++++++++++- upcoming-release-notes/3703.md | 6 ++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 upcoming-release-notes/3703.md diff --git a/packages/desktop-client/src/components/budget/MonthPicker.tsx b/packages/desktop-client/src/components/budget/MonthPicker.tsx index 501bafd79ff..2e55840eb85 100644 --- a/packages/desktop-client/src/components/budget/MonthPicker.tsx +++ b/packages/desktop-client/src/components/budget/MonthPicker.tsx @@ -1,13 +1,19 @@ // @ts-strict-ignore -import { type CSSProperties, useState } from 'react'; +import React, { type CSSProperties, useState } from 'react'; import * as monthUtils from 'loot-core/src/shared/months'; import { useResizeObserver } from '../../hooks/useResizeObserver'; import { styles, theme } from '../../style'; +import { Link } from '../common/Link'; import { View } from '../common/View'; import { type BoundsProps } from './MonthsContext'; +import { + buttonPrimaryBorder, + cardBorder, + menuBorder, +} from '../../style/themes/light'; type MonthPickerProps = { startMonth: string; @@ -78,6 +84,19 @@ export const MonthPicker = ({ justifyContent: 'center', }} > + onSelect(currentMonth)} + style={{ + position: 'absolute', + left: 0, + padding: '2.2px 3px', + border: `1px solid ${theme.buttonPrimaryBorder}`, + }} + > + Now + {range.map((month, idx) => { const monthName = monthUtils.format(month, 'MMM'); const selected = diff --git a/upcoming-release-notes/3703.md b/upcoming-release-notes/3703.md new file mode 100644 index 00000000000..ade91d5e666 --- /dev/null +++ b/upcoming-release-notes/3703.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [UnderKoen] +--- + +Add button to go to current month in budget view