Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add buttons for combined-account transaction pages on mobile #3734

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
44 changes: 31 additions & 13 deletions packages/desktop-client/src/components/mobile/accounts/Accounts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useAccounts } from '../../../hooks/useAccounts';
import { useFailedAccounts } from '../../../hooks/useFailedAccounts';
import { useNavigate } from '../../../hooks/useNavigate';
import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { SvgAdd } from '../../../icons/v1';
import { SvgAdd, SvgCheveronRight } from '../../../icons/v1';
import { theme, styles } from '../../../style';
import { makeAmountFullStyle } from '../../budget/util';
import { Button } from '../../common/Button2';
Expand All @@ -20,36 +20,49 @@ import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { MOBILE_NAV_HEIGHT } from '../MobileNavTabs';
import { PullToRefresh } from '../PullToRefresh';

function AccountHeader({ name, amount, style = {} }) {
function AccountHeader({ id, name, amount, style = {} }) {
const navigate = useNavigate();

return (
<View
<Button
variant="bare"
aria-label={`View ${name} transactions`}
onPress={() => navigate(`/accounts/${id}`)}
style={{
flex: 1,
flexDirection: 'row',
marginTop: 10,
marginRight: 10,
paddingTop: 7,
paddingBottom: 7,
paddingLeft: 0,
paddingRight: 0,
color: theme.pageTextLight,
width: '100%',
...style,
}}
>
<View style={{ flex: 1 }}>
<View style={{ flex: 1, alignItems: 'center', flexDirection: 'row' }}>
<Text
style={{
...styles.text,
fontSize: 14,
}}
data-testid="name"
>
{name}
</Text>
<SvgCheveronRight
style={{
flexShrink: 0,
color: theme.mobileHeaderTextSubdued,
marginLeft: 5,
}}
width={styles.text.fontSize}
height={styles.text.fontSize}
/>
</View>
<CellValue binding={amount} type="financial">
{props => (
<CellValueText {...props} style={{ ...styles.text, fontSize: 14 }} />
)}
{props => <CellValueText {...props} style={{ ...styles.text }} />}
</CellValue>
</View>
</Button>
);
}

Expand Down Expand Up @@ -186,7 +199,11 @@ function AccountList({
<PullToRefresh onRefresh={onSync}>
<View style={{ margin: 10 }}>
{budgetedAccounts.length > 0 && (
<AccountHeader name="For Budget" amount={getOnBudgetBalance()} />
<AccountHeader
id="budgeted"
name="For Budget"
amount={getOnBudgetBalance()}
/>
)}
{budgetedAccounts.map(acct => (
<AccountCard
Expand All @@ -203,9 +220,10 @@ function AccountList({

{offbudgetAccounts.length > 0 && (
<AccountHeader
id="offbudget"
name="Off Budget"
amount={getOffBudgetBalance()}
style={{ marginTop: 30 }}
style={{ marginTop: 20 }}
/>
)}
{offbudgetAccounts.map(acct => (
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3734.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [GabeKlavans]
---

Add navigation to combined-accounts transactions lists from the accounts page on mobile.