Adjust TC/Council prop display (#8869)
This commit is contained in:
parent
0b2bb1b3a8
commit
3565edfb0f
@ -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'>
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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'>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user