From 38eeb4a425e3546b655cf5b929a2c58094513a24 Mon Sep 17 00:00:00 2001 From: 12975 <1297598740@qq.com> Date: Mon, 26 Jan 2026 02:02:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=94=B6=E5=85=A5?= =?UTF-8?q?=E5=88=86=E9=85=8D=E8=A7=84=E5=88=99=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8F=8A=E8=B4=A6=E6=88=B7=E3=80=81=E8=BD=AC=E8=B4=A6?= =?UTF-8?q?=E3=80=81=E4=BA=A4=E6=98=93=E3=80=81=E5=88=86=E9=85=8D=E8=A7=84?= =?UTF-8?q?=E5=88=99=E7=AD=89=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/AccountCard/AccountCard.tsx | 5 ++- .../account/TransferForm/TransferForm.tsx | 5 ++- .../AllocationRuleForm/AllocationRuleForm.tsx | 5 ++- .../RecurringTransactionForm.tsx | 3 +- .../TransactionFilter/TransactionFilter.tsx | 7 +-- .../TransactionItem/TransactionItem.tsx | 13 ++++-- src/pages/AllocationRules/AllocationRules.tsx | 3 +- src/utils/iconUtils.ts | 45 +++++++++++++++++++ 8 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 src/utils/iconUtils.ts diff --git a/src/components/account/AccountCard/AccountCard.tsx b/src/components/account/AccountCard/AccountCard.tsx index 14ce7c2..ed684e8 100644 --- a/src/components/account/AccountCard/AccountCard.tsx +++ b/src/components/account/AccountCard/AccountCard.tsx @@ -7,6 +7,7 @@ import React from 'react'; import type { Account, AccountType } from '../../../types'; import { formatCurrency } from '../../../utils/format'; import { Icon } from '@iconify/react'; +import { isIconifyIcon } from '../../../utils/iconUtils'; import './AccountCard.css'; interface AccountCardProps { @@ -101,7 +102,9 @@ export const AccountCard: React.FC = ({
-
{icon}
+
+ {isIconifyIcon(icon) ? : icon} +
{onEdit && ( diff --git a/src/components/account/TransferForm/TransferForm.tsx b/src/components/account/TransferForm/TransferForm.tsx index d3b6ead..9f676d0 100644 --- a/src/components/account/TransferForm/TransferForm.tsx +++ b/src/components/account/TransferForm/TransferForm.tsx @@ -6,6 +6,7 @@ import React, { useState, useEffect } from 'react'; import type { Account, TransferFormInput } from '../../../types'; import { formatCurrency } from '../../../utils/format'; +import { getDisplayIcon } from '../../../utils/iconUtils'; import './TransferForm.css'; interface TransferFormProps { @@ -136,7 +137,7 @@ export const TransferForm: React.FC = ({ {accounts.map((account) => ( ))} @@ -179,7 +180,7 @@ export const TransferForm: React.FC = ({ {availableToAccounts.map((account) => ( ))} diff --git a/src/components/budget/AllocationRuleForm/AllocationRuleForm.tsx b/src/components/budget/AllocationRuleForm/AllocationRuleForm.tsx index 87a8e67..f4e0fc4 100644 --- a/src/components/budget/AllocationRuleForm/AllocationRuleForm.tsx +++ b/src/components/budget/AllocationRuleForm/AllocationRuleForm.tsx @@ -12,6 +12,7 @@ import type { AllocationTargetInput, } from '../../../services/allocationRuleService'; import { getTargetTypeLabel } from '../../../services/allocationRuleService'; +import { getDisplayIcon } from '../../../utils/iconUtils'; import './AllocationRuleForm.css'; interface AllocationRuleFormProps { @@ -283,7 +284,7 @@ export const AllocationRuleForm: React.FC = ({ {accounts.map((account) => ( ))} @@ -382,7 +383,7 @@ export const AllocationRuleForm: React.FC = ({ ) : ( accounts.map((account) => ( )) ) diff --git a/src/components/transaction/RecurringTransactionForm/RecurringTransactionForm.tsx b/src/components/transaction/RecurringTransactionForm/RecurringTransactionForm.tsx index d484717..c74e269 100644 --- a/src/components/transaction/RecurringTransactionForm/RecurringTransactionForm.tsx +++ b/src/components/transaction/RecurringTransactionForm/RecurringTransactionForm.tsx @@ -21,6 +21,7 @@ import { calculateNextOccurrence, } from '../../../services/recurringTransactionService'; import { Icon } from '@iconify/react'; +import { getDisplayIcon } from '../../../utils/iconUtils'; import './RecurringTransactionForm.css'; interface RecurringTransactionFormProps { @@ -417,7 +418,7 @@ export const RecurringTransactionForm: React.FC = {accounts.map((account) => ( ))} diff --git a/src/components/transaction/TransactionFilter/TransactionFilter.tsx b/src/components/transaction/TransactionFilter/TransactionFilter.tsx index 259172d..baac53e 100644 --- a/src/components/transaction/TransactionFilter/TransactionFilter.tsx +++ b/src/components/transaction/TransactionFilter/TransactionFilter.tsx @@ -9,6 +9,7 @@ import { Icon } from '@iconify/react'; import type { Category, Account, TransactionType } from '../../../types'; import { getCategories } from '../../../services/categoryService'; import { getAccounts } from '../../../services/accountService'; +import { getDisplayIcon } from '../../../utils/iconUtils'; import './TransactionFilter.css'; export interface FilterValues { @@ -256,8 +257,8 @@ export const TransactionFilter: React.FC = ({