Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…frontend into develop
  • Loading branch information
Keith-CY committed Jul 5, 2024
2 parents 759a945 + a88b2fe commit b0919ea
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/pages/RGBPP/TransactionList/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ const getFilterList = (t: TFunction): Record<'key' | 'title' | 'value' | 'to', s
},
{
key: 'leap_out',
value: 'out',
value: 'leapoutBTC',
title: t('address.leap_out'),
to: '',
},
{
key: 'equal',
value: 'equal',
title: '-',
key: 'leap_with_in_btc',
value: 'withinBTC',
title: t('address.leap_with_in_btc'),
to: '',
},
]
Expand Down
10 changes: 1 addition & 9 deletions src/pages/RGBPP/TransactionList/List/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ const Item = ({ item }: { item: Transaction }) => {
const statistics = useStatistics()
const tipBlockNumber = parseInt(statistics?.tipBlockNumber ?? '0', 10)

let leapDirection = '/'
if (item.type === TransactionLeapDirection.IN) {
leapDirection = t('address.leap_in')
}

if (item.type === TransactionLeapDirection.OUT) {
leapDirection = t('address.leap_out')
}
const { data: identity } = useQuery({
queryKey: ['btc-testnet-identity', item.btcTxId],
queryFn: () => (item.btcTxId ? getBtcChainIdentify(item.btcTxId) : null),
Expand Down Expand Up @@ -71,7 +63,7 @@ const Item = ({ item }: { item: Transaction }) => {
{dayjs(item.time).fromNow()}
</td>
<td className={styles.type} title={t('rgbpp.transaction.type')}>
{leapDirection}
{item.type === TransactionLeapDirection.NONE ? '/' : t(`address.leap_${item.type}`)}
</td>
<td className={styles.cellChange} title={t('rgbpp.transaction.rgbpp_cell_change')}>
{`${item.cellChange > 0 ? '+' : ''}${item.cellChange}`}{' '}
Expand Down
18 changes: 12 additions & 6 deletions src/pages/RGBPP/TransactionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ const RGBPPTransactionList = () => {
transactions: data.ckbTransactions.map<Transaction>(tx => {
let leapDirection = TransactionLeapDirection.NONE

if (tx.leapDirection === 'in') {
leapDirection = TransactionLeapDirection.IN
}

if (tx.leapDirection === '') {
leapDirection = TransactionLeapDirection.OUT
switch (tx.leapDirection) {
case 'in':
leapDirection = TransactionLeapDirection.IN
break
case 'leapoutBTC':
leapDirection = TransactionLeapDirection.OUT
break
case 'withinBTC':
leapDirection = TransactionLeapDirection.WITH_IN_BTC
break
default:
leapDirection = TransactionLeapDirection.NONE
}

return {
Expand Down

0 comments on commit b0919ea

Please sign in to comment.