Interleave even with 0 current bids (#5603)

* Interleave even with 0 current bids

* keys

* Interleave single only when raises

* Adjust key
This commit is contained in:
Jaco 2021-06-15 14:42:35 +03:00 committed by GitHub
parent a8b61c11b1
commit 0778eb8d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 16 deletions

View File

@ -92,20 +92,36 @@ function Auction ({ auctionInfo, campaigns, className, winningData }: Props): Re
header={headerRef.current}
noBodyTag
>
{auctionInfo && newRaise && winningData?.map(({ blockNumber, winners }, round) => (
<tbody key={round}>
{interleave(winners, round !== 0 || winningData.length !== 1).map((value, index) => (
<WinRange
auctionInfo={auctionInfo}
blockNumber={blockNumber}
isFirst={index === 0}
isLatest={round === 0}
key={`${blockNumber.toString()}:${value.key}`}
value={value}
/>
))}
</tbody>
))}
{auctionInfo && newRaise && winningData && (
winningData.length
? winningData.map(({ blockNumber, winners }, round) => (
<tbody key={round}>
{interleave(winners, round !== 0 || winningData.length !== 1).map((value, index) => (
<WinRange
auctionInfo={auctionInfo}
blockNumber={blockNumber}
isFirst={index === 0}
isLatest={round === 0}
key={`${blockNumber.toString()}:${value.key}`}
value={value}
/>
))}
</tbody>
))
: newRaise && (newRaise.length !== 0) && (
<tbody key='latest-crowd'>
{interleave([], false).map((value, index) => (
<WinRange
auctionInfo={auctionInfo}
isFirst={index === 0}
isLatest
key={`latest-crowd:${value.key}`}
value={value}
/>
))}
</tbody>
)
)}
</Table>
);
}

View File

@ -14,7 +14,7 @@ import { useTranslation } from '../translate';
interface Props {
auctionInfo: AuctionInfo;
blockNumber: BN;
blockNumber?: BN;
className?: string;
isFirst: boolean;
isLatest: boolean;
@ -30,7 +30,7 @@ function WinRanges ({ auctionInfo, blockNumber, className = '', isFirst, isLates
{isFirst && (
<h1>{isLatest
? t<string>('latest')
: <>#{formatNumber(blockNumber.isZero() ? auctionInfo.endBlock : blockNumber)}</>
: <>#{formatNumber((!blockNumber || blockNumber.isZero()) ? auctionInfo.endBlock : blockNumber)}</>
}</h1>
)}
</td>