From cf0cba3a963c9d37aebfe571749a2abbfb743a43 Mon Sep 17 00:00:00 2001 From: Ashray Chowdhry Date: Wed, 29 Jan 2025 13:52:27 -0500 Subject: [PATCH] tabledetail + cleanups --- public/locales/en-US/translations.json | 3 +- public/locales/es-ES/translations.json | 3 +- public/locales/fr-FR/translations.json | 3 +- public/locales/ja-JP/translations.json | 3 +- public/locales/ko-KR/translations.json | 3 +- .../CredentialAccept/TableDetail.tsx | 35 +++++++++++++++++++ .../Transaction/CredentialAccept/index.ts | 2 +- .../PermissionedDomainDelete/index.ts | 4 +-- .../PermissionedDomainSet/Simple.tsx | 19 +++++----- .../PermissionedDomainSet/index.ts | 4 +-- .../shared/components/Transaction/index.ts | 4 +++ 11 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx diff --git a/public/locales/en-US/translations.json b/public/locales/en-US/translations.json index 9c122173d..3a2edee4f 100644 --- a/public/locales/en-US/translations.json +++ b/public/locales/en-US/translations.json @@ -567,6 +567,7 @@ "credential_type": "Credential Type", "subject": "Subject", "expiration": "Expiration", - "domain_id": "Domain ID" + "domain_id": "Domain ID", + "accepted_credentials": "Accepted Credentials" } diff --git a/public/locales/es-ES/translations.json b/public/locales/es-ES/translations.json index 95b8bfb30..e6da8e90a 100644 --- a/public/locales/es-ES/translations.json +++ b/public/locales/es-ES/translations.json @@ -560,5 +560,6 @@ "credential_type": null, "subject": null, "expiration": null, - "domain_id": null + "domain_id": null, + "accepted_credentials": null } diff --git a/public/locales/fr-FR/translations.json b/public/locales/fr-FR/translations.json index 7644db455..412be7de2 100644 --- a/public/locales/fr-FR/translations.json +++ b/public/locales/fr-FR/translations.json @@ -561,5 +561,6 @@ "credential_type": null, "subject": null, "expiration": null, - "domain_id": null + "domain_id": null, + "accepted_credentials": null } diff --git a/public/locales/ja-JP/translations.json b/public/locales/ja-JP/translations.json index 8de8fdf0d..b35a5e364 100644 --- a/public/locales/ja-JP/translations.json +++ b/public/locales/ja-JP/translations.json @@ -560,5 +560,6 @@ "credential_type": null, "subject": null, "expiration": null, - "domain_id": null + "domain_id": null, + "accepted_credentials": null } diff --git a/public/locales/ko-KR/translations.json b/public/locales/ko-KR/translations.json index f78ca7a2a..015533e01 100644 --- a/public/locales/ko-KR/translations.json +++ b/public/locales/ko-KR/translations.json @@ -558,5 +558,6 @@ "credential_type": null, "subject": null, "expiration": null, - "domain_id": null + "domain_id": null, + "accepted_credentials": null } diff --git a/src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx b/src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx new file mode 100644 index 000000000..02bcba718 --- /dev/null +++ b/src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx @@ -0,0 +1,35 @@ +import { useTranslation } from 'react-i18next' +import { type CredentialAccept } from 'xrpl' +import { TransactionTableDetailProps } from '../types' +import { convertHexToString } from '../../../../../rippled/lib/utils' + +export const TableDetail = ({ + instructions, +}: TransactionTableDetailProps) => { + const { t } = useTranslation() + const { Account, Issuer, CredentialType } = instructions + return ( +
+ {Account && ( +
+ {t('account')}: + {Account} +
+ )} + {Issuer && ( +
+ {t('issuer')}: + {Issuer} +
+ )} + {Issuer && ( +
+ {t('credential_type')}: + + {convertHexToString(CredentialType)} + +
+ )} +
+ ) +} diff --git a/src/containers/shared/components/Transaction/CredentialAccept/index.ts b/src/containers/shared/components/Transaction/CredentialAccept/index.ts index 84477160d..0b8884932 100644 --- a/src/containers/shared/components/Transaction/CredentialAccept/index.ts +++ b/src/containers/shared/components/Transaction/CredentialAccept/index.ts @@ -8,6 +8,6 @@ import { Simple } from './Simple' export const CredentialAcceptTransaction: TransactionMapping = { Simple, - action: TransactionAction.ACCEPT, + action: TransactionAction.MODIFY, category: TransactionCategory.ACCOUNT, } diff --git a/src/containers/shared/components/Transaction/PermissionedDomainDelete/index.ts b/src/containers/shared/components/Transaction/PermissionedDomainDelete/index.ts index 4723e3d48..a9a0319ad 100644 --- a/src/containers/shared/components/Transaction/PermissionedDomainDelete/index.ts +++ b/src/containers/shared/components/Transaction/PermissionedDomainDelete/index.ts @@ -6,8 +6,8 @@ import { import { Simple } from './Simple' -export const CredentialCreateTransaction: TransactionMapping = { +export const PermissionedDomainDeleteTransaction: TransactionMapping = { Simple, - action: TransactionAction.CREATE, + action: TransactionAction.CANCEL, category: TransactionCategory.ACCOUNT, } diff --git a/src/containers/shared/components/Transaction/PermissionedDomainSet/Simple.tsx b/src/containers/shared/components/Transaction/PermissionedDomainSet/Simple.tsx index 3910433f6..c4fb0b7c2 100644 --- a/src/containers/shared/components/Transaction/PermissionedDomainSet/Simple.tsx +++ b/src/containers/shared/components/Transaction/PermissionedDomainSet/Simple.tsx @@ -23,15 +23,16 @@ const Simple: TransactionSimpleComponent = ( {DomainID} )} - {AcceptedCredentials && - AcceptedCredentials.map((credential) => ( - - {credential} - - ))} + {AcceptedCredentials && ( + + {AcceptedCredentials.map((credential) => ( +
{credential}
+ ))} +
+ )} ) } diff --git a/src/containers/shared/components/Transaction/PermissionedDomainSet/index.ts b/src/containers/shared/components/Transaction/PermissionedDomainSet/index.ts index 4723e3d48..f7810c7b2 100644 --- a/src/containers/shared/components/Transaction/PermissionedDomainSet/index.ts +++ b/src/containers/shared/components/Transaction/PermissionedDomainSet/index.ts @@ -6,8 +6,8 @@ import { import { Simple } from './Simple' -export const CredentialCreateTransaction: TransactionMapping = { +export const PermissionedDomainSetTransaction: TransactionMapping = { Simple, - action: TransactionAction.CREATE, + action: TransactionAction.MODIFY, category: TransactionCategory.ACCOUNT, } diff --git a/src/containers/shared/components/Transaction/index.ts b/src/containers/shared/components/Transaction/index.ts index f0d5171a1..36c3ca66d 100644 --- a/src/containers/shared/components/Transaction/index.ts +++ b/src/containers/shared/components/Transaction/index.ts @@ -29,6 +29,8 @@ import { PaymentTransaction as Payment } from './Payment' import { PaymentChannelClaimTransaction as PaymentChannelClaim } from './PaymentChannelClaim' import { PaymentChannelCreateTransaction as PaymentChannelCreate } from './PaymentChannelCreate' import { PaymentChannelFundTransaction as PaymentChannelFund } from './PaymentChannelFund' +import { PermissionedDomainDeleteTransaction as PermissionedDomainDelete } from './PermissionedDomainDelete' +import { PermissionedDomainSetTransaction as PermissionedDomainSet } from './PermissionedDomainSet' import { SetFeeTransaction as SetFee } from './SetFee' import { SetHookTransaction as SetHook } from './SetHook' import { SetRegularKeyTransaction as SetRegularKey } from './SetRegularKey' @@ -82,6 +84,8 @@ export const transactionTypes: { [key: string]: TransactionMapping } = { PaymentChannelCreate, PaymentChannelClaim, PaymentChannelFund, + PermissionedDomainDelete, + PermissionedDomainSet, SetFee, SetHook, SetRegularKey,