Skip to content

Commit

Permalink
tabledetail + cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
achowdhry-ripple committed Jan 29, 2025
1 parent 9522b3b commit cf0cba3
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 19 deletions.
3 changes: 2 additions & 1 deletion public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@
"credential_type": "Credential Type",
"subject": "Subject",
"expiration": "Expiration",
"domain_id": "Domain ID"
"domain_id": "Domain ID",
"accepted_credentials": "Accepted Credentials"

}
3 changes: 2 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,6 @@
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null
"domain_id": null,
"accepted_credentials": null
}
3 changes: 2 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,6 @@
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null
"domain_id": null,
"accepted_credentials": null
}
3 changes: 2 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,6 @@
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null
"domain_id": null,
"accepted_credentials": null
}
3 changes: 2 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,5 +558,6 @@
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null
"domain_id": null,
"accepted_credentials": null
}
Original file line number Diff line number Diff line change
@@ -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<CredentialAccept>) => {
const { t } = useTranslation()
const { Account, Issuer, CredentialType } = instructions
return (
<div className="credential">
{Account && (
<div className="uri">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
)}
{Issuer && (
<div className="issuer">
<span className="label">{t('issuer')}: </span>
<span className="case-sensitive">{Issuer}</span>
</div>
)}
{Issuer && (
<div className="credential-type">
<span className="label">{t('credential_type')}: </span>
<span className="case-sensitive">
{convertHexToString(CredentialType)}
</span>
</div>
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import { Simple } from './Simple'

export const CredentialAcceptTransaction: TransactionMapping = {
Simple,
action: TransactionAction.ACCEPT,
action: TransactionAction.MODIFY,
category: TransactionCategory.ACCOUNT,
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ const Simple: TransactionSimpleComponent = (
{DomainID}
</SimpleRow>
)}
{AcceptedCredentials &&
AcceptedCredentials.map((credential) => (
<SimpleRow
label={t('accepted_credential')}
data-test="accepted-credential'"
>
{credential}
</SimpleRow>
))}
{AcceptedCredentials && (
<SimpleRow
label={t('accepted_credentials')}
data-test="accepted-credentials"
>
{AcceptedCredentials.map((credential) => (
<div>{credential}</div>
))}
</SimpleRow>
)}
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
4 changes: 4 additions & 0 deletions src/containers/shared/components/Transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -82,6 +84,8 @@ export const transactionTypes: { [key: string]: TransactionMapping } = {
PaymentChannelCreate,
PaymentChannelClaim,
PaymentChannelFund,
PermissionedDomainDelete,
PermissionedDomainSet,
SetFee,
SetHook,
SetRegularKey,
Expand Down

0 comments on commit cf0cba3

Please sign in to comment.