File tree 2 files changed +31
-2
lines changed
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { type AccountEntity } from 'loot-core/types/models';
24
24
import { useContextMenu } from '../../hooks/useContextMenu' ;
25
25
import { useNotes } from '../../hooks/useNotes' ;
26
26
import { useDispatch } from '../../redux' ;
27
+ import { makeAmountFullStyle } from '../budget/util' ;
27
28
import { Link } from '../common/Link' ;
28
29
import { Notes } from '../Notes' ;
29
30
import {
@@ -34,7 +35,7 @@ import {
34
35
type OnDropCallback ,
35
36
} from '../sort' ;
36
37
import { type SheetFields , type Binding } from '../spreadsheet' ;
37
- import { CellValue } from '../spreadsheet/CellValue' ;
38
+ import { CellValue , CellValueText } from '../spreadsheet/CellValue' ;
38
39
39
40
export const accountNameStyle : CSSProperties = {
40
41
marginTop : - 2 ,
@@ -217,7 +218,29 @@ export function Account<FieldName extends SheetFields<'account'>>({
217
218
name
218
219
)
219
220
}
220
- right = { < CellValue binding = { query } type = "financial" /> }
221
+ right = {
222
+ < CellValue binding = { query } type = "financial" >
223
+ { props => {
224
+ const value = props . value as number ;
225
+
226
+ return (
227
+ < CellValueText
228
+ { ...props }
229
+ value = { value }
230
+ style = {
231
+ account
232
+ ? makeAmountFullStyle ( value , {
233
+ positiveColor : theme . sidebarItemText ,
234
+ negativeColor : theme . errorTextMenu ,
235
+ zeroColor : theme . sidebarItemText ,
236
+ } )
237
+ : null
238
+ }
239
+ />
240
+ ) ;
241
+ } }
242
+ </ CellValue >
243
+ }
221
244
/>
222
245
</ Link >
223
246
{ account && (
Original file line number Diff line number Diff line change
1
+ ---
2
+ category : Features
3
+ authors : [tostasmistas]
4
+ ---
5
+
6
+ Color negative account balances in the sidebar
You can’t perform that action at this time.
0 commit comments