migrate income&expense overview card and monthly income&expense card to composition API and typescript

This commit is contained in:
MaysWind
2025-01-12 02:10:40 +08:00
parent 9bbe4d2dcf
commit 5cacfc8daf
6 changed files with 512 additions and 275 deletions
+5 -1
View File
@@ -3,7 +3,11 @@ import { ALL_CURRENCIES, DEFAULT_CURRENCY_SYMBOL } from '@/consts/currency.ts';
import { isString, isNumber } from './common.ts';
export function getCurrencyFraction(currencyCode: string): number | undefined {
export function getCurrencyFraction(currencyCode?: string): number | undefined {
if (!currencyCode) {
return undefined;
}
const currencyInfo = ALL_CURRENCIES[currencyCode];
return currencyInfo?.fraction;
}
+1 -1
View File
@@ -10,7 +10,7 @@ export function getSystemTheme(): ThemeType {
}
}
export function getExpenseAndIncomeAmountColor(expenseAmountColorType: number, incomeAmountColorType: number, isDarkMode: boolean): AmountColor {
export function getExpenseAndIncomeAmountColor(expenseAmountColorType: number, incomeAmountColorType: number, isDarkMode?: boolean): AmountColor {
let expenseAmountColor = expenseAmountColorType ? PresetAmountColor.valueOf(expenseAmountColorType) : null;
let incomeAmountColor = incomeAmountColorType ? PresetAmountColor.valueOf(incomeAmountColorType) : null;