From 4bef127d36388080d44ea33e3faafb3fcb60da43 Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Sun, 3 Nov 2024 19:26:24 +0100 Subject: [PATCH] feat: now button on budget --- .../src/components/budget/MonthPicker.tsx | 16 +++++++++++++++- upcoming-release-notes/3703.md | 6 ++++++ 2 files changed, 21 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..aa6260e3d0c 100644 --- a/packages/desktop-client/src/components/budget/MonthPicker.tsx +++ b/packages/desktop-client/src/components/budget/MonthPicker.tsx @@ -1,10 +1,11 @@ // @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'; @@ -78,6 +79,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