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
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
import React from 'react';
|
|
|
|
import useApiQuery from 'lib/api/useApiQuery';
|
|
import { INTERCHAIN_MESSAGE, INTERCHAIN_STATS_COMMON } 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 TransactionsCrossChainContent from './TransactionsCrossChainContent';
|
|
import TransactionsCrossChainStats from './TransactionsCrossChainStats';
|
|
|
|
const TransactionsCrossChain = () => {
|
|
const { data, isPlaceholderData, isError, pagination } = useQueryWithPages({
|
|
resourceName: 'interchainIndexer:messages',
|
|
options: {
|
|
placeholderData: generateListStub<'interchainIndexer:messages'>(INTERCHAIN_MESSAGE, 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_messages).toLocaleString() } cross-chain transactions found
|
|
</Skeleton>
|
|
);
|
|
|
|
const actionBar = <StickyPaginationWithText text={ actionBarText } pagination={ pagination }/>;
|
|
|
|
return (
|
|
<>
|
|
<TransactionsCrossChainStats/>
|
|
<TransactionsCrossChainContent
|
|
items={ data?.items }
|
|
isLoading={ isPlaceholderData }
|
|
pagination={ pagination }
|
|
isError={ isError }
|
|
actionBar={ actionBar }
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TransactionsCrossChain);
|