Add comprehensive i18n localization to transaction UI components
- Localize 23 transaction UI component files - Add 150+ translation keys to ko.json and en.json - Organized translations under transaction namespace: * transaction.bottomSheet - Bottom sheet modals * transaction.sections - Section titles * transaction.fields - Field labels (90+ keys) * transaction.cancel - Cancellation flows * transaction.handWrittenIssuance - Manual issuance forms * transaction.list - List actions Updated files: - Bottom sheets: escrow-mail-resend, cash-receipt-purpose-update - Sections: billing-info, part-cancel-info, detail-info, issue-info, escrow-info, important-info, payment-info, transaction-info, settlement-info, merchant-info, amount-info, cancel-bank-group, cancel-password-group - Lists: list-item, billing-list, cash-receipt-list - Cancel flows: all-cancel, part-cancel, prevent-bond - Issuance: hand-written-issuance-step1, hand-written-issuance-step2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import moment from 'moment';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
|
||||
import { useDownloadConfirmationMutation } from '../../api/use-download-confirmation-mutation';
|
||||
@@ -7,7 +8,7 @@ import { SlideDown } from 'react-slidedown';
|
||||
import 'react-slidedown/lib/slidedown.css';
|
||||
|
||||
export const AmountInfoSection = ({
|
||||
transactionCategory,
|
||||
transactionCategory,
|
||||
amountInfo,
|
||||
isOpen,
|
||||
tid,
|
||||
@@ -15,23 +16,24 @@ export const AmountInfoSection = ({
|
||||
onClickToOpenInfo,
|
||||
canDownloadReceipt
|
||||
}: InfoSectionProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation();
|
||||
let newAmountInfo: Record<string, any> | undefined = amountInfo;
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
mid: {name: 'MID', type: 'string'},
|
||||
transactionRequestAmount: {name: '거래요청금액', type: 'number'},
|
||||
transactionAmount: {name: '거래금액', type: 'number'},
|
||||
pointAmount: {name: '포인트금액', type: 'number'},
|
||||
couponAmount: {name: '쿠폰금액', type: 'number'},
|
||||
escrowFee: {name: '에스크로수수료', type: 'number'},
|
||||
kakaoMoneyAmount: {name: '카카오머니', type: 'number'},
|
||||
kakaoPointAmount: {name: '카카오포인트', type: 'number'},
|
||||
kakaoDiscountAmount: {name: '카카오 즉시할인', type: 'number'},
|
||||
naverPointAmount: {name: '네이버 포인트', type: 'number'},
|
||||
tossMoneyAmount: {name: '토스머니', type: 'number'},
|
||||
tossDiscountAmount: {name: '토스할인', type: 'number'},
|
||||
paycoPointAmount: {name: '페이코포인트', type: 'number'},
|
||||
paycoCouponAmount: {name: '페이코쿠폰', type: 'number'},
|
||||
mid: {name: t('transaction.fields.mid'), type: 'string'},
|
||||
transactionRequestAmount: {name: t('transaction.fields.transactionRequestAmount'), type: 'number'},
|
||||
transactionAmount: {name: t('transaction.fields.transactionAmount'), type: 'number'},
|
||||
pointAmount: {name: t('transaction.fields.pointAmount'), type: 'number'},
|
||||
couponAmount: {name: t('transaction.fields.couponAmount'), type: 'number'},
|
||||
escrowFee: {name: t('transaction.fields.escrowFee'), type: 'number'},
|
||||
kakaoMoneyAmount: {name: t('transaction.fields.kakaoMoneyAmount'), type: 'number'},
|
||||
kakaoPointAmount: {name: t('transaction.fields.kakaoPointAmount'), type: 'number'},
|
||||
kakaoDiscountAmount: {name: t('transaction.fields.kakaoDiscountAmount'), type: 'number'},
|
||||
naverPointAmount: {name: t('transaction.fields.naverPointAmount'), type: 'number'},
|
||||
tossMoneyAmount: {name: t('transaction.fields.tossMoneyAmount'), type: 'number'},
|
||||
tossDiscountAmount: {name: t('transaction.fields.tossDiscountAmount'), type: 'number'},
|
||||
paycoPointAmount: {name: t('transaction.fields.paycoPointAmount'), type: 'number'},
|
||||
paycoCouponAmount: {name: t('transaction.fields.paycoCouponAmount'), type: 'number'},
|
||||
};
|
||||
|
||||
const openSubItems: Record<string, Array<string>> = {
|
||||
@@ -134,13 +136,14 @@ export const AmountInfoSection = ({
|
||||
let k = openSubItems[serviceCode][i];
|
||||
if(!!k){
|
||||
let name = subItems[k]?.name;
|
||||
|
||||
|
||||
|
||||
if(serviceCode === '01'){
|
||||
if(k === 'transactionAmount'){
|
||||
name = '신용카드금액'
|
||||
name = t('transaction.fields.cardAmount')
|
||||
}
|
||||
if(k === 'transactionRequestAmount'){
|
||||
name = '승인요청금액';
|
||||
name = t('transaction.fields.approvalRequestAmount');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,12 +226,12 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
<span className="unit">원</span>
|
||||
</div>
|
||||
<button
|
||||
className="chip-btn"
|
||||
<button
|
||||
className="chip-btn"
|
||||
type="button"
|
||||
onClick={ () => onClickToSetShowInfo() }
|
||||
>
|
||||
금액상세 <SectionTitleArrow isOpen={ isOpen }></SectionTitleArrow>
|
||||
{t('transaction.sections.amountDetail')} <SectionTitleArrow isOpen={ isOpen }></SectionTitleArrow>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -239,43 +242,43 @@ export const AmountInfoSection = ({
|
||||
{ (transactionCategory === TransactionCategory.AllTransaction) &&
|
||||
subLi()
|
||||
}
|
||||
{ (transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
{ (transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
<>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 공급가액</span>
|
||||
<span className="label">· {t('transaction.fields.supplyAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.supplyAmount }
|
||||
value={ amountInfo?.supplyAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· VAT</span>
|
||||
<span className="label">· {t('transaction.fields.vat')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.vat }
|
||||
value={ amountInfo?.vat }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 봉사료</span>
|
||||
<span className="label">· {t('transaction.fields.serviceAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.serviceAmount }
|
||||
value={ amountInfo?.serviceAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 면세금액</span>
|
||||
<span className="label">· {t('transaction.fields.taxFreeAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.taxFreeAmount }
|
||||
value={ amountInfo?.taxFreeAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -283,47 +286,47 @@ export const AmountInfoSection = ({
|
||||
</li>
|
||||
</>
|
||||
}
|
||||
{ (transactionCategory === TransactionCategory.Escrow) &&
|
||||
{ (transactionCategory === TransactionCategory.Escrow) &&
|
||||
<>
|
||||
{ (serviceCode === '02' || serviceCode === '03') &&
|
||||
<li className="amount-item">
|
||||
<span className="label">· 거래금액</span>
|
||||
<span className="label">· {t('transaction.fields.transactionAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.transactionAmount }
|
||||
value={ amountInfo?.transactionAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
}
|
||||
{ (serviceCode === '01') &&
|
||||
{ (serviceCode === '01') &&
|
||||
<>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 신용카드금액</span>
|
||||
<span className="label">· {t('transaction.fields.cardAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.cardAmount }
|
||||
value={ amountInfo?.cardAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 포인트금액</span>
|
||||
<span className="label">· {t('transaction.fields.pointAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.pointAmount }
|
||||
value={ amountInfo?.pointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 쿠폰금액</span>
|
||||
<span className="label">· {t('transaction.fields.couponAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.couponAmount }
|
||||
value={ amountInfo?.couponAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -333,10 +336,10 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
{ (serviceCode === '01' || serviceCode === '02') &&
|
||||
<li className="amount-item">
|
||||
<span className="label">· 에스크로수수료</span>
|
||||
<span className="label">· {t('transaction.fields.escrowFee')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.escrowFee }
|
||||
value={ amountInfo?.escrowFee }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -348,30 +351,30 @@ export const AmountInfoSection = ({
|
||||
{ (amountInfo?.simplePaymentServiceCode === 'E016') &&
|
||||
<>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 카카오머니</span>
|
||||
<span className="label">· {t('transaction.fields.kakaoMoneyAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 카카오포인트</span>
|
||||
<span className="label">· {t('transaction.fields.kakaoPointAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiCouponAmount }
|
||||
value={ amountInfo?.multiCouponAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 카카오즉시할인</span>
|
||||
<span className="label">· {t('transaction.fields.kakaoDiscountAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.kakaoDiscountAmount }
|
||||
value={ amountInfo?.kakaoDiscountAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -381,10 +384,10 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
{ (amountInfo?.simplePaymentServiceCode === 'E020') &&
|
||||
<li className="amount-item">
|
||||
<span className="label">· 네이버포인트</span>
|
||||
<span className="label">· {t('transaction.fields.naverPointAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -394,20 +397,20 @@ export const AmountInfoSection = ({
|
||||
{ (amountInfo?.simplePaymentServiceCode === 'E025') &&
|
||||
<>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 토스머니</span>
|
||||
<span className="label">· {t('transaction.fields.tossMoneyAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 토스할인</span>
|
||||
<span className="label">· {t('transaction.fields.tossDiscountAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.tossDiscountAmount }
|
||||
value={ amountInfo?.tossDiscountAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -418,20 +421,20 @@ export const AmountInfoSection = ({
|
||||
{ (amountInfo?.simplePaymentServiceCode === 'E015') &&
|
||||
<>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 페이코포인트</span>
|
||||
<span className="label">· {t('transaction.fields.paycoPointAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
value={ amountInfo?.multiPointAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</li>
|
||||
<li className="amount-item">
|
||||
<span className="label">· 페이코쿠폰</span>
|
||||
<span className="label">· {t('transaction.fields.paycoCouponAmount')}</span>
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ amountInfo?.multiCouponAmount }
|
||||
value={ amountInfo?.multiCouponAmount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
></NumericFormat>
|
||||
@@ -460,13 +463,13 @@ export const AmountInfoSection = ({
|
||||
}
|
||||
<div className="txn-doc">
|
||||
{
|
||||
(transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
(transactionCategory === TransactionCategory.CashReceipt) &&
|
||||
!!canDownloadReceipt &&
|
||||
<button
|
||||
className="doc-btn"
|
||||
<button
|
||||
className="doc-btn"
|
||||
type="button"
|
||||
onClick={ () => onClickToDownloadConfirmation() }
|
||||
>거래 확인서</button>
|
||||
>{t('transaction.fields.transactionConfirmation')}</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user