Add a "clear all" button to council vote (#3382)

* add clear all to council vote

* add parrentheses

* disabled rather than hidden

* Update packages/page-council/src/Overview/Vote.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
This commit is contained in:
Thibaut Sardan 2020-08-10 18:40:50 +02:00 committed by GitHub
parent ce730e655d
commit 922092b337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,19 @@ function Vote ({ electionsInfo }: Props): React.ReactElement<Props> {
</Modal.Columns>
</Modal.Content>
<Modal.Actions onCancel={toggleVisible}>
<TxButton
accountId={accountId}
icon='trash-alt'
isDisabled={!defaultVotes.length}
label={t<string>('Unvote all')}
onStart={toggleVisible}
params={[]}
tx={
api.tx.electionsPhragmen
? 'electionsPhragmen.removeVoter'
: 'elections.removeVoter'
}
/>
<TxButton
accountId={accountId}
isDisabled={!accountId || votes.length === 0 || voteValue.lten(0)}