diff --git a/packages/page-council/src/Overview/Vote.tsx b/packages/page-council/src/Overview/Vote.tsx index 241b463c8c..4b8a9aac5f 100644 --- a/packages/page-council/src/Overview/Vote.tsx +++ b/packages/page-council/src/Overview/Vote.tsx @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { DeriveElectionsInfo } from '@polkadot/api-derive/types'; +import type { BalanceOf } from '@polkadot/types/interfaces'; -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; -import { Button, InputAddress, InputAddressMulti, Modal, TxButton, VoteValue } from '@polkadot/react-components'; +import { Button, InputAddress, InputAddressMulti, InputBalance, Modal, TxButton, VoteValue } from '@polkadot/react-components'; import { useApi, useToggle } from '@polkadot/react-hooks'; import { BN_ZERO } from '@polkadot/util'; @@ -51,6 +52,13 @@ function Vote ({ electionsInfo }: Props): React.ReactElement { }); }, [api, accountId, available]); + const bondValue = useMemo( + () => ((api.consts.electionsPhragmen || api.consts.elections).votingBondBase as BalanceOf).add( + ((api.consts.electionsPhragmen || api.consts.elections).votingBondFactor as BalanceOf).muln(votes.length) + ), + [api, votes] + ); + return ( <>