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:
parent
a8b61c11b1
commit
0778eb8d87
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user