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
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
|
|
import useApiQuery from 'lib/api/useApiQuery';
|
|
import { INTERCHAIN_STATS_COMMON, INTERCHAIN_TRANSFER } from 'stubs/interchainIndexer';
|
|
import { generateListStub } from 'stubs/utils';
|
|
import { Skeleton } from 'toolkit/chakra/skeleton';
|
|
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
|
import StickyPaginationWithText from 'ui/shared/StickyPaginationWithText';
|
|
|
|
import TokenTransfersCrossChainContent from './TokenTransfersCrossChainContent';
|
|
|
|
const TokenTransfersCrossChain = () => {
|
|
const { data, isPlaceholderData, isError, pagination } = useQueryWithPages({
|
|
resourceName: 'interchainIndexer:transfers',
|
|
options: {
|
|
placeholderData: generateListStub<'interchainIndexer:transfers'>(INTERCHAIN_TRANSFER, 50, { next_page_params: { page_token: 'token' } }),
|
|
},
|
|
});
|
|
const statsQuery = useApiQuery('interchainIndexer:stats_common', {
|
|
queryOptions: {
|
|
placeholderData: INTERCHAIN_STATS_COMMON,
|
|
},
|
|
});
|
|
|
|
const actionBarText = (
|
|
<Skeleton loading={ statsQuery.isPlaceholderData || isPlaceholderData }>
|
|
A total of { Number(statsQuery.data?.total_transfers).toLocaleString() } cross-chain token transfers found
|
|
</Skeleton>
|
|
);
|
|
|
|
const actionBar = <StickyPaginationWithText text={ actionBarText } pagination={ pagination }/>;
|
|
|
|
return (
|
|
<TokenTransfersCrossChainContent
|
|
items={ data?.items }
|
|
isLoading={ isPlaceholderData }
|
|
pagination={ pagination }
|
|
isError={ isError }
|
|
itemsNum={ data?.items.length }
|
|
actionBar={ actionBar }
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TokenTransfersCrossChain);
|