ghost-portal/packages/page-bounties/src/DueBlocks.tsx
Jaco Greeff 6bcfabaaed
Bounty DueBlocks (human time-first, aligned with UI) (#4651)
* Initial bounty re-align (table borders, font colors)

* DueBlocks (align with UI counters, time first)
2021-02-11 12:31:37 +01:00

32 lines
686 B
TypeScript

// Copyright 2017-2021 @polkadot/app-bounties authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import React from 'react';
import { BlockToTime } from '@polkadot/react-query';
import { formatNumber } from '@polkadot/util';
interface Props {
dueBlocks: BN;
endBlock: BN;
label: string;
}
function DueBlocks ({ dueBlocks, endBlock, label }: Props): React.ReactElement<Props> {
return (
<>
{dueBlocks.gtn(0) && (
<>
<BlockToTime blocks={dueBlocks}>
&nbsp;({label})
</BlockToTime>
#{formatNumber(endBlock)}
</>
)}
</>
);
}
export default React.memo(DueBlocks);