Skip to content

Commit

Permalink
tabledetails for permissioneddomain
Browse files Browse the repository at this point in the history
  • Loading branch information
achowdhry-ripple committed Jan 29, 2025
1 parent 7472ae5 commit efbbce0
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const TableDetail = ({
const { t } = useTranslation()
const { Account, Issuer, CredentialType } = instructions
return (
<div className="credential">
<div className="credentialAccept">
{Account && (
<div className="uri">
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { createTableDetailWrapperFactory } from '../../test'
import { TableDetail } from '../TableDetail'
import mockCredentialAccept from './mock_data/CredentialAccept.json'

const createWrapper = createTableDetailWrapperFactory(TableDetail)

describe('CredentialAcceptTableDetail', () => {
it('renders CredentialAccept without crashing', () => {
const wrapper = createWrapper(mockCredentialAccept)

expect(wrapper.find('[data-test="account"]')).toHaveText(
` rLbgNAngLq3HABBXK4uPGCHrqeZwgaYi7q `,
)
expect(wrapper.find('[data-test="amount"]')).toHaveText(`997.50 XRP`)
expect(wrapper.find('[data-test="condition"]')).toHaveText(
` A0258020886F982742772F414243855DC13B348FC78FB3D5119412C8A6480114E36A4451810120 `,
)
expect(wrapper.find('[data-test="finish_after"]')).toHaveText(
`March 1, 2020 at 9:01:00 AM UTC`,
)
expect(wrapper.find('[data-test="cancel_after"]')).toHaveText(
`March 1, 2020 at 8:54:20 AM UTC`,
)

wrapper.unmount()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const TableDetail = ({
const { t } = useTranslation()
const { Account, Subject, CredentialType, Expiration, URI } = instructions
return (
<div className="credential">
<div className="credentialCreate">
{Account && (
<div className="uri">
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const TableDetail = ({
const { t } = useTranslation()
const { Account, Subject, Issuer, CredentialType } = instructions
return (
<div className="credential">
<div className="credentialDelete">
{Account && (
<div className="uri">
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useTranslation } from 'react-i18next'
import { type PermissionedDomainDelete } from 'xrpl'

Check failure on line 2 in src/containers/shared/components/Transaction/PermissionedDomainDelete/TableDetail.tsx

View workflow job for this annotation

GitHub Actions / typescript-check (18.12)

Module '"xrpl"' has no exported member 'PermissionedDomainDelete'.
import { TransactionTableDetailProps } from '../types'

export const TableDetail = ({
instructions,
}: TransactionTableDetailProps<PermissionedDomainDelete>) => {
const { t } = useTranslation()
const { Account, DomainID } = instructions
return (
<div className="permissionedDomainDelete">
{Account && (
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
)}
{DomainID && (
<div className="domainId">
<span className="label">{t('domain_id')}: </span>
<span className="case-sensitive">{DomainID}</span>
</div>
)}
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useTranslation } from 'react-i18next'
import { type PermissionedDomainSet } from 'xrpl'
import { TransactionTableDetailProps } from '../types'

export const TableDetail = ({
instructions,
}: TransactionTableDetailProps<PermissionedDomainSet>) => {
const { t } = useTranslation()
const { Account, DomainID, AcceptedCredentials } = instructions
return (
<div className="permissionedDomainSet">
{Account && (
<div className="account">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
)}
{DomainID && (
<div className="domainId">
<span className="label">{t('domain_id')}: </span>
<span className="case-sensitive">{DomainID}</span>
</div>
)}
{AcceptedCredentials && (
<div className="acceptedCredentials">
<span className="label">{t('accepted_credentials')}: </span>
<span className="case-sensitive">{AcceptedCredentials}</span>
</div>
)}
</div>
)
}

0 comments on commit efbbce0

Please sign in to comment.