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 3bbd753
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/desktop-client/src/components/budget/MonthPicker.tsx
Original file line number Diff line number Diff line change
@@ -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';

Check warning on line 11 in packages/desktop-client/src/components/budget/MonthPicker.tsx

View workflow job for this annotation

GitHub Actions / lint

There should be at least one empty line between import groups
import {

Check warning on line 12 in packages/desktop-client/src/components/budget/MonthPicker.tsx

View workflow job for this annotation

GitHub Actions / lint

`../../style/themes/light` import should occur before import of `../common/Link`
buttonPrimaryBorder,

Check warning on line 13 in packages/desktop-client/src/components/budget/MonthPicker.tsx

View workflow job for this annotation

GitHub Actions / lint

'buttonPrimaryBorder' is defined but never used. Allowed unused vars must match /^(_|React)/u
cardBorder,

Check warning on line 14 in packages/desktop-client/src/components/budget/MonthPicker.tsx

View workflow job for this annotation

GitHub Actions / lint

'cardBorder' is defined but never used. Allowed unused vars must match /^(_|React)/u
menuBorder,

Check warning on line 15 in packages/desktop-client/src/components/budget/MonthPicker.tsx

View workflow job for this annotation

GitHub Actions / lint

'menuBorder' is defined but never used. Allowed unused vars must match /^(_|React)/u
} from '../../style/themes/light';

type MonthPickerProps = {
startMonth: string;
Expand Down Expand Up @@ -78,6 +84,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 3bbd753

Please sign in to comment.