Commit e13f04e4 authored by tom's avatar tom

fix table header

parent e98ecfa1
...@@ -34,6 +34,8 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI ...@@ -34,6 +34,8 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI
options: { enabled: !isDisabled }, options: { enabled: !isDisabled },
}); });
const isPaginatorHidden = pagination.page === 1 && !pagination.hasNextPage;
const content = (() => { const content = (() => {
if (isLoading || isLoadingProp) { if (isLoading || isLoadingProp) {
return ( return (
...@@ -64,7 +66,7 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI ...@@ -64,7 +66,7 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI
return ( return (
<> <>
<Hide below="lg"> <Hide below="lg">
<TokenTransferTable data={ items } baseAddress={ baseAddress } showTxInfo={ showTxInfo }/> <TokenTransferTable data={ items } baseAddress={ baseAddress } showTxInfo={ showTxInfo } top={ isPaginatorHidden ? 0 : 80 }/>
</Hide> </Hide>
<Show below="lg"> <Show below="lg">
<TokenTransferList data={ items } baseAddress={ baseAddress } showTxInfo={ showTxInfo }/> <TokenTransferList data={ items } baseAddress={ baseAddress } showTxInfo={ showTxInfo }/>
...@@ -73,8 +75,6 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI ...@@ -73,8 +75,6 @@ const TokenTransfer = ({ isLoading: isLoadingProp, isDisabled, queryName, queryI
); );
})(); })();
const isPaginatorHidden = pagination.page === 1 && !pagination.hasNextPage;
return ( return (
<> <>
{ txHash && (data?.items.length || 0 > 0) && ( { txHash && (data?.items.length || 0 > 0) && (
......
...@@ -10,13 +10,14 @@ interface Props { ...@@ -10,13 +10,14 @@ interface Props {
data: Array<TokenTransfer>; data: Array<TokenTransfer>;
baseAddress?: string; baseAddress?: string;
showTxInfo?: boolean; showTxInfo?: boolean;
top: number;
} }
const TokenTransferTable = ({ data, baseAddress, showTxInfo }: Props) => { const TokenTransferTable = ({ data, baseAddress, showTxInfo, top }: Props) => {
return ( return (
<Table variant="simple" size="sm"> <Table variant="simple" size="sm">
<Thead top={ 80 }> <Thead top={ top }>
<Tr> <Tr>
{ showTxInfo && <Th width="44px"></Th> } { showTxInfo && <Th width="44px"></Th> }
<Th width="185px">Token</Th> <Th width="185px">Token</Th>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment