add unlock transaction

This commit is contained in:
kandrusyak
2022-12-09 11:53:36 +03:00
parent 68e665804c
commit 5939bb4e13
6 changed files with 80 additions and 137 deletions

View File

@@ -81,7 +81,11 @@ const Delegates = observer(() => {
<TransactionsTable
data={delegates}
lockedFor={lockedFor}
rowClick={(delegate) => setCurrentDelegate(delegate)}
rowClick={(delegate) =>
(lockedFor === 'Voiting' ||
store.accountLockedVotesCanReturnSum[delegate.address]) &&
setCurrentDelegate(delegate)
}
/>
{/*/!* Pagination *!/*/}
@@ -99,9 +103,11 @@ const Delegates = observer(() => {
transactionPanelOpen={!!currentDelegate}
onClose={() => setCurrentDelegate(null)}
delegate={currentDelegate || {}}
postTransaction={(address, amount) =>
store.pushVoteTransaction(address, amount)
}
unlocking={lockedFor !== 'Voiting'}
postTransaction={(address, amount) => {
if (lockedFor === 'Voiting') store.pushVoteTransaction(address, amount);
else store.pushUnlockTransaction(address);
}}
/>
</div>
</main>