Apply t('home.money') localization to important-info-section
- Remove NumericFormat import dependency
- Replace NumericFormat with t('home.money') pattern for amount display
- Remove hardcoded currency unit (원) - now included in locale
- Add null safety with || 0 for amount values
- Applied to dynamic important info fields (newImportantInfo)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { NumericFormat } from 'react-number-format';
|
|
||||||
import { InfoSectionProps, TransactionCategory } from '../../model/types';
|
import { InfoSectionProps, TransactionCategory } from '../../model/types';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { getAllTransactionStatusCode } from '../../model/contant';
|
import { getAllTransactionStatusCode } from '../../model/contant';
|
||||||
@@ -126,12 +125,7 @@ export const ImportantInfoSection = ({
|
|||||||
newImportantInfo[k]
|
newImportantInfo[k]
|
||||||
}
|
}
|
||||||
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'number') &&
|
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'number') &&
|
||||||
<NumericFormat
|
t('home.money', { value: new Intl.NumberFormat('en-US').format(newImportantInfo[k] || 0) })
|
||||||
value={ newImportantInfo[k] }
|
|
||||||
thousandSeparator
|
|
||||||
displayType="text"
|
|
||||||
suffix='원'
|
|
||||||
></NumericFormat>
|
|
||||||
}
|
}
|
||||||
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'date') &&
|
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'date') &&
|
||||||
moment(newImportantInfo[k]).format('YYYY.MM.DD')
|
moment(newImportantInfo[k]).format('YYYY.MM.DD')
|
||||||
|
|||||||
Reference in New Issue
Block a user