@@ -2,6 +2,8 @@ import React, { type CSSProperties, useCallback } from 'react';
2
2
import { useTranslation } from 'react-i18next' ;
3
3
import { useDispatch , useSelector } from 'react-redux' ;
4
4
5
+ import { css } from '@emotion/css' ;
6
+
5
7
import { replaceModal , syncAndDownload } from 'loot-core/src/client/actions' ;
6
8
import * as queries from 'loot-core/src/client/queries' ;
7
9
import { type AccountEntity } from 'loot-core/types/models' ;
@@ -10,7 +12,7 @@ import { useAccounts } from '../../../hooks/useAccounts';
10
12
import { useFailedAccounts } from '../../../hooks/useFailedAccounts' ;
11
13
import { useNavigate } from '../../../hooks/useNavigate' ;
12
14
import { useSyncedPref } from '../../../hooks/useSyncedPref' ;
13
- import { SvgAdd } from '../../../icons/v1' ;
15
+ import { SvgAdd , SvgCheveronRight } from '../../../icons/v1' ;
14
16
import { theme , styles } from '../../../style' ;
15
17
import { makeAmountFullStyle } from '../../budget/util' ;
16
18
import { Button } from '../../common/Button2' ;
@@ -24,48 +26,75 @@ import { MOBILE_NAV_HEIGHT } from '../MobileNavTabs';
24
26
import { PullToRefresh } from '../PullToRefresh' ;
25
27
26
28
type AccountHeaderProps < SheetFieldName extends SheetFields < 'account' > > = {
29
+ id : string ;
27
30
name : string ;
28
31
amount : Binding < 'account' , SheetFieldName > ;
29
32
style ?: CSSProperties ;
30
33
} ;
31
34
32
35
function AccountHeader < SheetFieldName extends SheetFields < 'account' > > ( {
36
+ id,
33
37
name,
34
38
amount,
35
39
style = { } ,
36
40
} : AccountHeaderProps < SheetFieldName > ) {
41
+ const navigate = useNavigate ( ) ;
42
+
37
43
return (
38
- < View
44
+ < Button
45
+ variant = "bare"
46
+ aria-label = { `View ${ name } transactions` }
47
+ onPress = { ( ) => navigate ( `/accounts/${ id } ` ) }
39
48
style = { {
40
49
flex : 1 ,
41
50
flexDirection : 'row' ,
42
- marginTop : 10 ,
43
- marginRight : 10 ,
51
+ paddingTop : 15 ,
52
+ paddingBottom : 15 ,
53
+ paddingLeft : 0 ,
54
+ paddingRight : 0 ,
44
55
color : theme . pageTextLight ,
45
56
width : '100%' ,
46
57
...style ,
47
58
} }
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
+ ] ) }
48
68
>
49
- < View style = { { flex : 1 } } >
69
+ < View style = { { flex : 1 , alignItems : 'center' , flexDirection : 'row' } } >
50
70
< Text
51
71
style = { {
52
72
...styles . text ,
53
- fontSize : 14 ,
73
+ fontSize : 17 ,
54
74
} }
55
75
data-testid = "name"
56
76
>
57
77
{ name }
58
78
</ 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
+ />
59
88
</ View >
60
89
< CellValue binding = { amount } type = "financial" >
61
90
{ props => (
62
91
< CellValueText < 'account' , SheetFieldName >
63
92
{ ...props }
64
- style = { { ...styles . text , fontSize : 14 } }
93
+ style = { { ...styles . text } }
65
94
/>
66
95
) }
67
96
</ CellValue >
68
- </ View >
97
+ </ Button >
69
98
) ;
70
99
}
71
100
@@ -227,7 +256,11 @@ function AccountList({
227
256
< PullToRefresh onRefresh = { onSync } >
228
257
< View aria-label = "Account list" style = { { margin : 10 } } >
229
258
{ onBudgetAccounts . length > 0 && (
230
- < AccountHeader name = "On budget" amount = { getOnBudgetBalance ( ) } />
259
+ < AccountHeader
260
+ id = "onbudget"
261
+ name = "On budget"
262
+ amount = { getOnBudgetBalance ( ) }
263
+ />
231
264
) }
232
265
{ onBudgetAccounts . map ( acct => (
233
266
< AccountCard
@@ -244,6 +277,7 @@ function AccountList({
244
277
245
278
{ offBudgetAccounts . length > 0 && (
246
279
< AccountHeader
280
+ id = "offbudget"
247
281
name = "Off budget"
248
282
amount = { getOffBudgetBalance ( ) }
249
283
style = { { marginTop : 30 } }
0 commit comments