Skip to content
Snippets Groups Projects
Unverified Commit 164dd399 authored by Joel Jeremy Marquez's avatar Joel Jeremy Marquez Committed by GitHub
Browse files

[Mobile] Add amount colors to mobile accounts and transaction list (#2665)

* Add amount colors to mobile transaction list

* Release notes

* Fix lint error

* Add amount colors to mobile accounts page

* VRT updates
parent f41d3f22
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 5 deletions
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -8,7 +8,7 @@ import { View } from '../common/View'; ...@@ -8,7 +8,7 @@ import { View } from '../common/View';
import { CellValue } from '../spreadsheet/CellValue'; import { CellValue } from '../spreadsheet/CellValue';
import { useSheetValue } from '../spreadsheet/useSheetValue'; import { useSheetValue } from '../spreadsheet/useSheetValue';
import { makeAmountStyle } from './util'; import { makeBalanceAmountStyle } from './util';
type BalanceWithCarryoverProps = { type BalanceWithCarryoverProps = {
carryover: ComponentProps<typeof CellValue>['binding']; carryover: ComponentProps<typeof CellValue>['binding'];
...@@ -41,7 +41,7 @@ export function BalanceWithCarryover({ ...@@ -41,7 +41,7 @@ export function BalanceWithCarryover({
binding={balance} binding={balance}
type="financial" type="financial"
getStyle={value => getStyle={value =>
makeAmountStyle( makeBalanceAmountStyle(
value, value,
isGoalTemplatesEnabled ? goalValue : null, isGoalTemplatesEnabled ? goalValue : null,
budgetedValue, budgetedValue,
...@@ -72,7 +72,11 @@ export function BalanceWithCarryover({ ...@@ -72,7 +72,11 @@ export function BalanceWithCarryover({
<SvgArrowThinRight <SvgArrowThinRight
width={carryoverStyle?.width || 7} width={carryoverStyle?.width || 7}
height={carryoverStyle?.height || 7} height={carryoverStyle?.height || 7}
style={makeAmountStyle(balanceValue, goalValue, budgetedValue)} style={makeBalanceAmountStyle(
balanceValue,
goalValue,
budgetedValue,
)}
/> />
</View> </View>
)} )}
......
...@@ -45,7 +45,7 @@ export function makeAmountGrey(value: number | string): CSSProperties { ...@@ -45,7 +45,7 @@ export function makeAmountGrey(value: number | string): CSSProperties {
: null; : null;
} }
export function makeAmountStyle( export function makeBalanceAmountStyle(
value: number, value: number,
goalValue?: number, goalValue?: number,
budgetedValue?: number, budgetedValue?: number,
......
...@@ -11,6 +11,7 @@ import { useNavigate } from '../../../hooks/useNavigate'; ...@@ -11,6 +11,7 @@ import { useNavigate } from '../../../hooks/useNavigate';
import { useSetThemeColor } from '../../../hooks/useSetThemeColor'; import { useSetThemeColor } from '../../../hooks/useSetThemeColor';
import { SvgAdd } from '../../../icons/v1'; import { SvgAdd } from '../../../icons/v1';
import { theme, styles } from '../../../style'; import { theme, styles } from '../../../style';
import { makeAmountFullStyle } from '../../budget/util';
import { Button } from '../../common/Button'; import { Button } from '../../common/Button';
import { Text } from '../../common/Text'; import { Text } from '../../common/Text';
import { TextOneLine } from '../../common/TextOneLine'; import { TextOneLine } from '../../common/TextOneLine';
...@@ -135,7 +136,7 @@ function AccountCard({ ...@@ -135,7 +136,7 @@ function AccountCard({
binding={getBalanceQuery(account)} binding={getBalanceQuery(account)}
type="financial" type="financial"
style={{ fontSize: 16, color: 'inherit' }} style={{ fontSize: 16, color: 'inherit' }}
getStyle={value => value < 0 && { color: 'inherit' }} getStyle={makeAmountFullStyle}
data-testid="account-balance" data-testid="account-balance"
/> />
</Button> </Button>
......
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
SvgLockClosed, SvgLockClosed,
} from '../../../icons/v2'; } from '../../../icons/v2';
import { styles, theme } from '../../../style'; import { styles, theme } from '../../../style';
import { makeAmountFullStyle } from '../../budget/util';
import { Button } from '../../common/Button'; import { Button } from '../../common/Button';
import { Text } from '../../common/Text'; import { Text } from '../../common/Text';
import { TextOneLine } from '../../common/TextOneLine'; import { TextOneLine } from '../../common/TextOneLine';
...@@ -208,6 +209,7 @@ export const Transaction = memo(function Transaction({ ...@@ -208,6 +209,7 @@ export const Transaction = memo(function Transaction({
marginLeft: 25, marginLeft: 25,
marginRight: 5, marginRight: 5,
fontSize: 14, fontSize: 14,
...makeAmountFullStyle(amount),
}} }}
> >
{integerToCurrency(amount)} {integerToCurrency(amount)}
......
---
category: Enhancements
authors: [joel-jeremy]
---
Add amount colors to mobile accounts and transaction list.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment