Skip to content

Commit

Permalink
Update balance colors
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Apr 11, 2024
1 parent bdd64d1 commit 476e0db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ export function CategoryItem({
display: !showBalances ? 'none' : undefined,
marginLeft: 5,
flexShrink: 0,
...makeAmountFullStyle(isToBeBudgetedItem ? toBudget : balance),
...makeAmountFullStyle(isToBeBudgetedItem ? toBudget : balance, {
positiveColor: theme.noticeTextMenu,
negativeColor: theme.errorTextMenu,
}),
}}
>
{isToBeBudgetedItem
Expand Down
18 changes: 12 additions & 6 deletions packages/desktop-client/src/components/budget/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ export function makeAmountStyle(
}
}

export function makeAmountFullStyle(value: number) {
export function makeAmountFullStyle(
value: number,
colors?: {
positiveColor?: string;
negativeColor?: string;
zeroColor?: string;
},
) {
const _positiveColor = colors.positiveColor || theme.noticeText;
const _negativeColor = colors.negativeColor || theme.errorText;
const _zeroColor = colors.zeroColor || theme.tableTextSubdued;
return {
color:
value < 0
? theme.errorText
: value === 0
? theme.tableTextSubdued
: theme.noticeText,
value < 0 ? _negativeColor : value === 0 ? _zeroColor : _positiveColor,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/style/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const errorBackground = colorPalette.red800;
export const errorText = colorPalette.red200;
export const errorTextDark = colorPalette.red150;
export const errorTextDarker = errorTextDark;
export const errorTextMenu = colorPalette.red500;
export const errorTextMenu = colorPalette.red200;
export const errorBorder = colorPalette.red500;
export const upcomingBackground = colorPalette.purple700;
export const upcomingText = colorPalette.purple100;
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/style/themes/midnight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const errorBackground = colorPalette.red800;
export const errorText = colorPalette.red200;
export const errorTextDark = colorPalette.red150;
export const errorTextDarker = errorTextDark;
export const errorTextMenu = colorPalette.red500;
export const errorTextMenu = colorPalette.red200;
export const errorBorder = colorPalette.red500;
export const upcomingBackground = colorPalette.purple800;
export const upcomingText = colorPalette.purple200;
Expand Down

0 comments on commit 476e0db

Please sign in to comment.