Small fixes to provide council page compatibility (#8791)

* small fixes to provide council page compatibility

* Suggestions to get CI to lint

* Update packages/page-democracy/src/Overview/ProposalCell.tsx

Co-authored-by: Jaco <jacogr@gmail.com>
This commit is contained in:
Peter White 2023-01-14 01:52:01 -07:00 committed by GitHub
parent 61907aa568
commit 357d969b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 14 deletions

View File

@ -28,19 +28,26 @@ function Voters ({ balance, voters }: Props): React.ReactElement<Props> {
return (
<>
<td className='expand'>
<ExpanderScroll
className={balance ? '' : '--tmp'}
renderChildren={renderVoters}
summary={<FormatBalance value={balance} />}
/>
</td>
<td className='number'>
{voters
? formatNumber(voters.length)
: <span className='--tmp'>123</span>
}
</td>
{voters
? (
<>
<td className='expand'>
<ExpanderScroll
className={balance ? '' : '--tmp'}
renderChildren={renderVoters}
summary={<FormatBalance value={balance} />}
/>
</td>
<td className='number'>
{voters
? formatNumber(voters.length)
: <span className='--tmp'>123</span>
}
</td>
</>
)
: <td colSpan={2} />
}
</>
);
}

View File

@ -31,7 +31,7 @@ function ProposalCell ({ className = '', imageHash, proposal }: Props): React.Re
const preimage = usePreimage(imageHash);
// while we still have this endpoint, democracy will use it
const displayProposal = api.query.democracy.preimages
const displayProposal = api.query.democracy?.preimages
? proposal
: preimage?.proposal;