Skip to content

Commit

Permalink
Add today button on mobile budget page (actualbudget#4380)
Browse files Browse the repository at this point in the history
* feat: today button on mobile budget page

Jumps to the current month

* add release note

* cleaner onCurrentMonth

* Update VRT

* use SvgCalendar from icons/v2

Co-authored-by: Matt Fiddaman <[email protected]>

* Update VRT

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Fiddaman <[email protected]>
  • Loading branch information
3 people authored and lelemm committed Feb 18, 2025
1 parent df25849 commit 2601ea0
Show file tree
Hide file tree
Showing 102 changed files with 25 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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
SvgArrowThickRight,
SvgCheveronRight,
} from '../../../icons/v1';
import { SvgViewShow } from '../../../icons/v2';
import { SvgCalendar, SvgViewShow } from '../../../icons/v2';
import { useDispatch } from '../../../redux';
import { theme, styles } from '../../../style';
import { BalanceWithCarryover } from '../../budget/BalanceWithCarryover';
Expand Down Expand Up @@ -1627,6 +1627,7 @@ export function BudgetTable({
// editMode,
onPrevMonth,
onNextMonth,
onCurrentMonth,
onSaveGroup,
onDeleteGroup,
onAddCategory,
Expand Down Expand Up @@ -1693,6 +1694,16 @@ export function BudgetTable({
/>
</Button>
}
rightContent={
<Button
variant="bare"
onPress={onCurrentMonth}
aria-label={t('Today')}
style={{ margin: 10 }}
>
<SvgCalendar width={20} height={20} />
</Button>
}
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ export function Budget() {
setInitialized(true);
}, [budgetType, setStartMonthPref, spreadsheet, startMonth]);

const onCurrentMonth = useCallback(async () => {
await prewarmMonth(budgetType, spreadsheet, currMonth);
setStartMonthPref(currMonth);
setInitialized(true);
}, [budgetType, setStartMonthPref, spreadsheet, currMonth]);

// const onOpenMonthActionMenu = () => {
// const options = [
// 'Copy last month’s budget',
Expand Down Expand Up @@ -500,6 +506,7 @@ export function Budget() {
onShowBudgetSummary={onShowBudgetSummary}
onPrevMonth={onPrevMonth}
onNextMonth={onNextMonth}
onCurrentMonth={onCurrentMonth}
onSaveGroup={onSaveGroup}
onDeleteGroup={onDeleteGroup}
onAddCategory={onOpenNewCategoryModal}
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/4380.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [adastx]
---

Add button to go to current month in budget view on mobile

0 comments on commit 2601ea0

Please sign in to comment.