Skip to content

Commit

Permalink
feat: now button on budget
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Nov 3, 2024
1 parent 6666014 commit 023fb54
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion packages/desktop-client/src/components/budget/MonthPicker.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -78,6 +79,19 @@ export const MonthPicker = ({
justifyContent: 'center',
}}
>
<Link
variant="button"
buttonVariant="bare"
onPress={() => onSelect(currentMonth)}
style={{
position: 'absolute',
left: 0,
padding: '2.2px 3px',
border: `1px solid ${theme.buttonPrimaryBorder}`,
}}
>
Now
</Link>
{range.map((month, idx) => {
const monthName = monthUtils.format(month, 'MMM');
const selected =
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3703.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [UnderKoen]
---

Add button to go to current month in budget view

0 comments on commit 023fb54

Please sign in to comment.