Adjust TC/Council prop display (#8869)

This commit is contained in:
Jaco 2023-01-23 16:13:23 +02:00 committed by GitHub
parent 0b2bb1b3a8
commit 3565edfb0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -64,6 +64,7 @@ function Motion ({ className = '', isMember, members, motion: { hash, proposal,
<Table.Column.Id value={index} />
<ProposalCell
imageHash={hash}
isCollective
proposal={proposal}
/>
<td className='number together'>

View File

@ -18,21 +18,24 @@ import TreasuryCell from './TreasuryCell';
interface Props {
className?: string;
imageHash: Hash | HexString;
isCollective?: boolean;
proposal?: Proposal | null;
}
const METHOD_EXTE = ['externalPropose', 'externalProposeDefault', 'externalProposeMajority', 'fastTrack'];
const METHOD_TREA = ['approveProposal', 'rejectProposal'];
function ProposalCell ({ className = '', imageHash, proposal }: Props): React.ReactElement<Props> {
function ProposalCell ({ className = '', imageHash, isCollective, proposal }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const preimage = usePreimage(imageHash);
// while we still have this endpoint, democracy will use it
const displayProposal = api.query.democracy?.preimages
const displayProposal = isCollective
? proposal
: preimage?.proposal;
: api.query.democracy?.preimages
? proposal
: preimage?.proposal;
if (!displayProposal) {
const textHash = imageHash.toString();

View File

@ -42,6 +42,7 @@ function Proposal ({ className = '', imageHash, isMember, members, prime, type }
<Table.Column.Id value={index} />
<ProposalCell
imageHash={imageHash}
isCollective
proposal={derive.proposal}
/>
<td className='number'>