Skip to content

Commit 7472ae5

Browse files
tabledetails
1 parent cf0cba3 commit 7472ae5

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const TableDetail = ({
2222
<span className="case-sensitive">{Issuer}</span>
2323
</div>
2424
)}
25-
{Issuer && (
25+
{CredentialType && (
2626
<div className="credential-type">
2727
<span className="label">{t('credential_type')}: </span>
2828
<span className="case-sensitive">
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { useTranslation } from 'react-i18next'
2+
import { type CredentialCreate } from 'xrpl'
3+
import { TransactionTableDetailProps } from '../types'
4+
import { convertHexToString } from '../../../../../rippled/lib/utils'
5+
6+
export const TableDetail = ({
7+
instructions,
8+
}: TransactionTableDetailProps<CredentialCreate>) => {
9+
const { t } = useTranslation()
10+
const { Account, Subject, CredentialType, Expiration, URI } = instructions
11+
return (
12+
<div className="credential">
13+
{Account && (
14+
<div className="uri">
15+
<span className="label">{t('account')}: </span>
16+
<span className="case-sensitive">{Account}</span>
17+
</div>
18+
)}
19+
{Subject && (
20+
<div className="issuer">
21+
<span className="label">{t('subject')}: </span>
22+
<span className="case-sensitive">{Subject}</span>
23+
</div>
24+
)}
25+
{CredentialType && (
26+
<div className="credential-type">
27+
<span className="label">{t('credential_type')}: </span>
28+
<span className="case-sensitive">
29+
{convertHexToString(CredentialType)}
30+
</span>
31+
</div>
32+
)}
33+
{Expiration && (
34+
<div className="expiration">
35+
<span className="label">{t('expiration')}: </span>
36+
<span className="case-sensitive">{Expiration}</span>
37+
</div>
38+
)}
39+
{URI && (
40+
<div className="uri">
41+
<span className="label">{t('uri')}: </span>
42+
<span className="case-sensitive">{URI}</span>
43+
</div>
44+
)}
45+
</div>
46+
)
47+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { useTranslation } from 'react-i18next'
2+
import { type CredentialDelete } from 'xrpl'
3+
import { TransactionTableDetailProps } from '../types'
4+
import { convertHexToString } from '../../../../../rippled/lib/utils'
5+
6+
export const TableDetail = ({
7+
instructions,
8+
}: TransactionTableDetailProps<CredentialDelete>) => {
9+
const { t } = useTranslation()
10+
const { Account, Subject, Issuer, CredentialType } = instructions
11+
return (
12+
<div className="credential">
13+
{Account && (
14+
<div className="uri">
15+
<span className="label">{t('account')}: </span>
16+
<span className="case-sensitive">{Account}</span>
17+
</div>
18+
)}
19+
{Subject && (
20+
<div className="issuer">
21+
<span className="label">{t('subject')}: </span>
22+
<span className="case-sensitive">{Subject}</span>
23+
</div>
24+
)}
25+
{Issuer && (
26+
<div className="issuer">
27+
<span className="label">{t('issuer')}: </span>
28+
<span className="case-sensitive">{Issuer}</span>
29+
</div>
30+
)}
31+
{CredentialType && (
32+
<div className="credential-type">
33+
<span className="label">{t('credential_type')}: </span>
34+
<span className="case-sensitive">
35+
{convertHexToString(CredentialType)}
36+
</span>
37+
</div>
38+
)}
39+
</div>
40+
)
41+
}

0 commit comments

Comments
 (0)