Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8f66605

Browse files
authoredJan 7, 2025··
add buttons for combined-account transaction pages on mobile (#3734)
* add buttons for combined-account transaction pages (#2333) * add release note for #3734 * add accessibility label to mobile combined-account header button * increase touch targets for combined-account buttons * remove highlight color and add bounce to header buttons to match the feel of the other account buttons * update vrt screenshots for actualbudget#3734
1 parent eadd11b commit 8f66605

5 files changed

+49
-9
lines changed
 

‎packages/desktop-client/src/components/mobile/accounts/Accounts.tsx

+43-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { type CSSProperties, useCallback } from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { useDispatch, useSelector } from 'react-redux';
44

5+
import { css } from '@emotion/css';
6+
57
import { replaceModal, syncAndDownload } from 'loot-core/src/client/actions';
68
import * as queries from 'loot-core/src/client/queries';
79
import { type AccountEntity } from 'loot-core/types/models';
@@ -10,7 +12,7 @@ import { useAccounts } from '../../../hooks/useAccounts';
1012
import { useFailedAccounts } from '../../../hooks/useFailedAccounts';
1113
import { useNavigate } from '../../../hooks/useNavigate';
1214
import { useSyncedPref } from '../../../hooks/useSyncedPref';
13-
import { SvgAdd } from '../../../icons/v1';
15+
import { SvgAdd, SvgCheveronRight } from '../../../icons/v1';
1416
import { theme, styles } from '../../../style';
1517
import { makeAmountFullStyle } from '../../budget/util';
1618
import { Button } from '../../common/Button2';
@@ -24,48 +26,75 @@ import { MOBILE_NAV_HEIGHT } from '../MobileNavTabs';
2426
import { PullToRefresh } from '../PullToRefresh';
2527

2628
type AccountHeaderProps<SheetFieldName extends SheetFields<'account'>> = {
29+
id: string;
2730
name: string;
2831
amount: Binding<'account', SheetFieldName>;
2932
style?: CSSProperties;
3033
};
3134

3235
function AccountHeader<SheetFieldName extends SheetFields<'account'>>({
36+
id,
3337
name,
3438
amount,
3539
style = {},
3640
}: AccountHeaderProps<SheetFieldName>) {
41+
const navigate = useNavigate();
42+
3743
return (
38-
<View
44+
<Button
45+
variant="bare"
46+
aria-label={`View ${name} transactions`}
47+
onPress={() => navigate(`/accounts/${id}`)}
3948
style={{
4049
flex: 1,
4150
flexDirection: 'row',
42-
marginTop: 10,
43-
marginRight: 10,
51+
paddingTop: 15,
52+
paddingBottom: 15,
53+
paddingLeft: 0,
54+
paddingRight: 0,
4455
color: theme.pageTextLight,
4556
width: '100%',
4657
...style,
4758
}}
59+
// to match the feel of the other account buttons
60+
className={css([
61+
{
62+
'&[data-pressed], &[data-hovered]': {
63+
backgroundColor: 'transparent',
64+
transform: 'translateY(1px)',
65+
},
66+
},
67+
])}
4868
>
49-
<View style={{ flex: 1 }}>
69+
<View style={{ flex: 1, alignItems: 'center', flexDirection: 'row' }}>
5070
<Text
5171
style={{
5272
...styles.text,
53-
fontSize: 14,
73+
fontSize: 17,
5474
}}
5575
data-testid="name"
5676
>
5777
{name}
5878
</Text>
79+
<SvgCheveronRight
80+
style={{
81+
flexShrink: 0,
82+
color: theme.mobileHeaderTextSubdued,
83+
marginLeft: 5,
84+
}}
85+
width={styles.text.fontSize}
86+
height={styles.text.fontSize}
87+
/>
5988
</View>
6089
<CellValue binding={amount} type="financial">
6190
{props => (
6291
<CellValueText<'account', SheetFieldName>
6392
{...props}
64-
style={{ ...styles.text, fontSize: 14 }}
93+
style={{ ...styles.text }}
6594
/>
6695
)}
6796
</CellValue>
68-
</View>
97+
</Button>
6998
);
7099
}
71100

@@ -227,7 +256,11 @@ function AccountList({
227256
<PullToRefresh onRefresh={onSync}>
228257
<View aria-label="Account list" style={{ margin: 10 }}>
229258
{onBudgetAccounts.length > 0 && (
230-
<AccountHeader name="On budget" amount={getOnBudgetBalance()} />
259+
<AccountHeader
260+
id="onbudget"
261+
name="On budget"
262+
amount={getOnBudgetBalance()}
263+
/>
231264
)}
232265
{onBudgetAccounts.map(acct => (
233266
<AccountCard
@@ -244,6 +277,7 @@ function AccountList({
244277

245278
{offBudgetAccounts.length > 0 && (
246279
<AccountHeader
280+
id="offbudget"
247281
name="Off budget"
248282
amount={getOffBudgetBalance()}
249283
style={{ marginTop: 30 }}

‎upcoming-release-notes/3734.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Enhancements
3+
authors: [GabeKlavans]
4+
---
5+
6+
Add navigation to combined-accounts transactions lists from the accounts page on mobile.

0 commit comments

Comments
 (0)
Please sign in to comment.