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';
import { CellValue } from '../spreadsheet/CellValue';
import { useSheetValue } from '../spreadsheet/useSheetValue';
import { makeAmountStyle } from './util';
import { makeBalanceAmountStyle } from './util';
type BalanceWithCarryoverProps = {
carryover: ComponentProps<typeof CellValue>['binding'];
......@@ -41,7 +41,7 @@ export function BalanceWithCarryover({
binding={balance}
type="financial"
getStyle={value =>
makeAmountStyle(
makeBalanceAmountStyle(
value,
isGoalTemplatesEnabled ? goalValue : null,
budgetedValue,
......@@ -72,7 +72,11 @@ export function BalanceWithCarryover({
<SvgArrowThinRight
width={carryoverStyle?.width || 7}
height={carryoverStyle?.height || 7}
style={makeAmountStyle(balanceValue, goalValue, budgetedValue)}
style={makeBalanceAmountStyle(
balanceValue,
goalValue,
budgetedValue,
)}
/>
</View>
)}
......
......@@ -45,7 +45,7 @@ export function makeAmountGrey(value: number | string): CSSProperties {
: null;
}
export function makeAmountStyle(
export function makeBalanceAmountStyle(
value: number,
goalValue?: number,
budgetedValue?: number,
......
......@@ -11,6 +11,7 @@ import { useNavigate } from '../../../hooks/useNavigate';
import { useSetThemeColor } from '../../../hooks/useSetThemeColor';
import { SvgAdd } from '../../../icons/v1';
import { theme, styles } from '../../../style';
import { makeAmountFullStyle } from '../../budget/util';
import { Button } from '../../common/Button';
import { Text } from '../../common/Text';
import { TextOneLine } from '../../common/TextOneLine';
......@@ -135,7 +136,7 @@ function AccountCard({
binding={getBalanceQuery(account)}
type="financial"
style={{ fontSize: 16, color: 'inherit' }}
getStyle={value => value < 0 && { color: 'inherit' }}
getStyle={makeAmountFullStyle}
data-testid="account-balance"
/>
</Button>
......
......@@ -14,6 +14,7 @@ import {
SvgLockClosed,
} from '../../../icons/v2';
import { styles, theme } from '../../../style';
import { makeAmountFullStyle } from '../../budget/util';
import { Button } from '../../common/Button';
import { Text } from '../../common/Text';
import { TextOneLine } from '../../common/TextOneLine';
......@@ -208,6 +209,7 @@ export const Transaction = memo(function Transaction({
marginLeft: 25,
marginRight: 5,
fontSize: 14,
...makeAmountFullStyle(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