Indicate council motion vote end (#2396)
* Indicate council motion vote end * Remove row border highlight (distracting)
This commit is contained in:
parent
04879147a8
commit
0895fdd208
@ -2,12 +2,15 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { AccountId } from '@polkadot/types/interfaces';
|
||||
import { AccountId, BlockNumber } from '@polkadot/types/interfaces';
|
||||
import { DerivedCollectiveProposal } from '@polkadot/api-derive/types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { AddressMini, LinkExternal } from '@polkadot/react-components';
|
||||
import ProposalCell from '@polkadot/app-democracy/Overview/ProposalCell';
|
||||
import { AddressMini, LinkExternal } from '@polkadot/react-components';
|
||||
import { useApi, useCall } from '@polkadot/react-hooks';
|
||||
import { BlockToTime } from '@polkadot/react-query';
|
||||
import { formatNumber } from '@polkadot/util';
|
||||
|
||||
import { useTranslation } from '../translate';
|
||||
@ -23,12 +26,14 @@ interface Props {
|
||||
|
||||
export default function Motion ({ className, isMember, members, motion: { hash, proposal, votes }, prime }: Props): React.ReactElement<Props> | null {
|
||||
const { t } = useTranslation();
|
||||
const { api } = useApi();
|
||||
const bestNumber = useCall<BlockNumber>(api.derive.chain.bestNumber, []) || new BN(0);
|
||||
|
||||
if (!votes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { ayes, index, nays, threshold } = votes;
|
||||
const { ayes, end, index, nays, threshold } = votes;
|
||||
|
||||
return (
|
||||
<tr className={className}>
|
||||
@ -62,6 +67,15 @@ export default function Motion ({ className, isMember, members, motion: { hash,
|
||||
/>
|
||||
))}
|
||||
</td>
|
||||
<td className='number together top'>
|
||||
{end && (
|
||||
<>
|
||||
<label>{t('voting end')}</label>
|
||||
<BlockToTime blocks={end.sub(bestNumber)} />
|
||||
#{formatNumber(end)}
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
<td className='number top together'>
|
||||
<Voting
|
||||
hash={hash}
|
||||
|
||||
@ -41,9 +41,9 @@ function DispatchEntry ({ blockNumber, hash, referendumIndex }: Props): React.Re
|
||||
<td className='number together top'>
|
||||
{blockNumber && (
|
||||
<>
|
||||
<label>{t('enact at')}</label>
|
||||
<label>{t('enact')}</label>
|
||||
<BlockToTime blocks={blockNumber.sub(bestNumber)} />
|
||||
{formatNumber(blockNumber)}
|
||||
#{formatNumber(blockNumber)}
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
|
||||
@ -106,9 +106,9 @@ function Referendum ({ className, idNumber, value }: Props): React.ReactElement<
|
||||
{t('{{blocks}} blocks', { replace: { blocks: formatNumber(remainBlock) } })}
|
||||
</td>
|
||||
<td className='number together top'>
|
||||
<label>{t('activate at')}</label>
|
||||
<label>{t('activate')}</label>
|
||||
<BlockToTime blocks={enactBlock.sub(bestNumber)} />
|
||||
{formatNumber(enactBlock)}
|
||||
#{formatNumber(enactBlock)}
|
||||
</td>
|
||||
<td className='number together top'>
|
||||
<label>{t('Aye ({{count}})', { replace: { count: formatNumber(voteCountAye) } })}</label>
|
||||
|
||||
@ -75,10 +75,6 @@ const Memo = React.memo(styled(Table)`
|
||||
label {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
td {
|
||||
border-color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(:hover) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user