Add initial proposing amount (#59)

* Add initial proposing amount

* Update packages/DApp/src/components/card/VoteModal.tsx

Co-authored-by: Szymon Szlachtowicz <38212223+Szymx95@users.noreply.github.com>

Co-authored-by: Szymon Szlachtowicz <38212223+Szymx95@users.noreply.github.com>
This commit is contained in:
Maria Rushkova 2021-06-24 17:40:09 +02:00 committed by GitHub
parent f8e3bb605e
commit ce1437a81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,9 @@ export interface VoteModalProps {
}
export function VoteModal({ vote, selectedVote, availableAmount, setShowConfirmModal }: VoteModalProps) {
const [proposingAmount, setProposingAmount] = useState(availableAmount)
const initialProposing = vote?.type === 'Remove' && availableAmount > 2000000 ? 2000000 : 0
const [proposingAmount, setProposingAmount] = useState(initialProposing)
const disabled = proposingAmount === 0
return (

View File

@ -26,7 +26,7 @@ export function VotePropose({
disabled,
setProposingAmount,
}: VoteProposingProps) {
const [displayAmount, setDisplayAmount] = useState(`${addCommas(availableAmount)} SNT`)
const [displayAmount, setDisplayAmount] = useState(addCommas(proposingAmount) + ' SNT')
let step = 10 ** (Math.floor(Math.log10(availableAmount)) - 2)
if (availableAmount < 100) {