Refactor expense form and categories
- Rename "지출 추가" to "지출 입력" in the add expense dialog. - Rename "교통비" to "교통" in categories and ensure all 4 icons are displayed on a single line.
This commit is contained in:
@@ -4,10 +4,11 @@ import { EXPENSE_CATEGORIES } from '@/constants/categoryIcons';
|
||||
/**
|
||||
* 카테고리 매핑 함수 - 이전 카테고리명을 새 카테고리명으로 변환
|
||||
*/
|
||||
export const mapCategoryToNew = (oldCategory: string): "음식" | "쇼핑" | "교통비" | "기타" => {
|
||||
export const mapCategoryToNew = (oldCategory: string): "음식" | "쇼핑" | "교통" | "기타" => {
|
||||
if (oldCategory === '식비') return '음식';
|
||||
if (oldCategory === '생활비') return '쇼핑';
|
||||
if (EXPENSE_CATEGORIES.includes(oldCategory as any)) return oldCategory as "음식" | "쇼핑" | "교통비" | "기타";
|
||||
if (oldCategory === '교통비') return '교통';
|
||||
if (EXPENSE_CATEGORIES.includes(oldCategory as any)) return oldCategory as "음식" | "쇼핑" | "교통" | "기타";
|
||||
// 기본값은 '기타'로 설정
|
||||
return '기타';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user