Skip to content
Snippets Groups Projects
Unverified Commit a9ee670e authored by youngcw's avatar youngcw Committed by GitHub
Browse files

change the mobile budget balance colors to be the same as desktop (#2940)

* change the mobile budget colors to be the same as desktop

* fix

* some lint and note

* actual note

* fix mad lint

* another lint
parent 3990aaf3
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,8 @@ type BalanceWithCarryoverProps = Omit< ...@@ -18,8 +18,8 @@ type BalanceWithCarryoverProps = Omit<
> & { > & {
carryover: Binding; carryover: Binding;
balance: Binding; balance: Binding;
goal?: Binding; goal: Binding;
budgeted?: Binding; budgeted: Binding;
disabled?: boolean; disabled?: boolean;
carryoverStyle?: CSSProperties; carryoverStyle?: CSSProperties;
}; };
...@@ -79,7 +79,7 @@ export function BalanceWithCarryover({ ...@@ -79,7 +79,7 @@ export function BalanceWithCarryover({
height={carryoverStyle?.height || 7} height={carryoverStyle?.height || 7}
style={makeBalanceAmountStyle( style={makeBalanceAmountStyle(
balanceValue, balanceValue,
goalValue, isGoalTemplatesEnabled ? goalValue : null,
budgetedValue, budgetedValue,
)} )}
/> />
......
...@@ -8,6 +8,7 @@ import { collapseModals, pushModal } from 'loot-core/client/actions'; ...@@ -8,6 +8,7 @@ import { collapseModals, pushModal } from 'loot-core/client/actions';
import { rolloverBudget, reportBudget } from 'loot-core/src/client/queries'; import { rolloverBudget, reportBudget } from 'loot-core/src/client/queries';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { useFeatureFlag } from '../../../hooks/useFeatureFlag';
import { useLocalPref } from '../../../hooks/useLocalPref'; import { useLocalPref } from '../../../hooks/useLocalPref';
import { useNavigate } from '../../../hooks/useNavigate'; import { useNavigate } from '../../../hooks/useNavigate';
import { SvgLogo } from '../../../icons/logo'; import { SvgLogo } from '../../../icons/logo';
...@@ -21,7 +22,7 @@ import { SvgViewShow } from '../../../icons/v2'; ...@@ -21,7 +22,7 @@ import { SvgViewShow } from '../../../icons/v2';
import { useResponsive } from '../../../ResponsiveProvider'; import { useResponsive } from '../../../ResponsiveProvider';
import { theme, styles } from '../../../style'; import { theme, styles } from '../../../style';
import { BalanceWithCarryover } from '../../budget/BalanceWithCarryover'; import { BalanceWithCarryover } from '../../budget/BalanceWithCarryover';
import { makeAmountFullStyle, makeAmountGrey } from '../../budget/util'; import { makeAmountGrey, makeBalanceAmountStyle } from '../../budget/util';
import { Button } from '../../common/Button'; import { Button } from '../../common/Button';
import { Card } from '../../common/Card'; import { Card } from '../../common/Card';
import { Label } from '../../common/Label'; import { Label } from '../../common/Label';
...@@ -331,6 +332,12 @@ const ExpenseCategory = memo(function ExpenseCategory({ ...@@ -331,6 +332,12 @@ const ExpenseCategory = memo(function ExpenseCategory({
}) { }) {
const opacity = blank ? 0 : 1; const opacity = blank ? 0 : 1;
const isGoalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled');
const goalTemp = useSheetValue(goal);
const goalValue = isGoalTemplatesEnabled ? goalTemp : null;
const budgetedTemp = useSheetValue(budgeted);
const budgetedValue = isGoalTemplatesEnabled ? budgetedTemp : null;
const [budgetType = 'rollover'] = useLocalPref('budgetType'); const [budgetType = 'rollover'] = useLocalPref('budgetType');
const dispatch = useDispatch(); const dispatch = useDispatch();
...@@ -574,9 +581,11 @@ const ExpenseCategory = memo(function ExpenseCategory({ ...@@ -574,9 +581,11 @@ const ExpenseCategory = memo(function ExpenseCategory({
mode="oneline" mode="oneline"
style={{ style={{
maxWidth: columnWidth, maxWidth: columnWidth,
...makeAmountFullStyle(value, { ...makeBalanceAmountStyle(
zeroColor: theme.pillTextSubdued, value,
}), goalValue,
budgetedValue,
),
textAlign: 'right', textAlign: 'right',
fontSize: 12, fontSize: 12,
}} }}
......
---
category: Bugfix
authors: [youngcw]
---
Fix mobile budget coloring to show template colors
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