mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* envs and feature setup * home page layout * cross-chain txs page * cross-chain transfers page * cross-chain transfers on tx page * cross-chain messages on tx page * cross-chain tx page * cross-chain tx details token transfers * stats and counters for lists * migrate to new API version * add swagger * mobile lists * placeholder views on address page * tests * fix adaptive tabs initial state when there is only one tab in the list * tweaks * bug fixes * fix tests * update screenshots * migrate to new api version * add chain label tooltip, copy button to txs in lists and same address highlight * list views on address page * fix tests * fix links to current address in the list views * update tooltips * update tables layout * review fixes * fix spelling * update screenshots * update screenshot
56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import TokenTransfersCrossChainListItem from 'ui/crossChain/transfers/TokenTransfersCrossChainListItem';
|
|
import TokenTransfersCrossChainTable from 'ui/crossChain/transfers/TokenTransfersCrossChainTable';
|
|
import { getItemKey } from 'ui/crossChain/transfers/utils';
|
|
import DataListDisplay from 'ui/shared/DataListDisplay';
|
|
import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPages';
|
|
|
|
import type { TxQuery } from '../useTxQuery';
|
|
|
|
interface Props {
|
|
txQuery: TxQuery;
|
|
crossChainQuery: QueryWithPagesResult<'interchainIndexer:tx_transfers'>;
|
|
isLoading?: boolean;
|
|
tableTop?: number;
|
|
}
|
|
|
|
const TxTokenTransferCrossChain = ({ txQuery, crossChainQuery, isLoading, tableTop }: Props) => {
|
|
const content = crossChainQuery.data?.items ? (
|
|
<>
|
|
<Box hideFrom="lg">
|
|
{ crossChainQuery.data.items.map((item, index) => (
|
|
<TokenTransfersCrossChainListItem
|
|
key={ getItemKey(item, crossChainQuery.isPlaceholderData ? index : undefined) }
|
|
data={ item }
|
|
isLoading={ isLoading || crossChainQuery.isPlaceholderData }
|
|
/>
|
|
)) }
|
|
</Box>
|
|
<Box hideBelow="lg">
|
|
<TokenTransfersCrossChainTable
|
|
data={ crossChainQuery.data.items }
|
|
isLoading={ isLoading || crossChainQuery.isPlaceholderData }
|
|
top={ tableTop }
|
|
/>
|
|
</Box>
|
|
</>
|
|
) : null;
|
|
|
|
return (
|
|
<DataListDisplay
|
|
isError={ txQuery.isError || crossChainQuery.isError }
|
|
itemsNum={ crossChainQuery.data?.items.length }
|
|
emptyText="There are no cross-chain token transfers."
|
|
emptyStateProps={{
|
|
term: 'token transfer',
|
|
}}
|
|
>
|
|
{ content }
|
|
</DataListDisplay>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TxTokenTransferCrossChain);
|