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:
parent
f8e3bb605e
commit
ce1437a81b
|
@ -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 (
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue