From acd15a3f8bc23200771240047b2cbdfb1d64fe99 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Alapont Date: Tue, 7 Jun 2022 15:25:59 -0500 Subject: [PATCH] Rename isVestingAccountWithoutGovernance by isLockButtonDisabled --- frontend/pages/staking.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/pages/staking.tsx b/frontend/pages/staking.tsx index bf526158..b2c1ff63 100644 --- a/frontend/pages/staking.tsx +++ b/frontend/pages/staking.tsx @@ -54,8 +54,8 @@ const Staking: NextPage = () => { const [isUnlockedModalOpen, setIsUnlockedModalOpen] = useState(false) const [isUnvestedModalOpen, setIsUnvestedModalOpen] = useState(false) const [ - isVestingAccountWithoutGovernance, - setIsVestingAccountWithoutGovernance, + isLockButtonDisabled, + setIsLockButtonDisabled, ] = useState(false) const [ multipleStakeAccountsModalOption, @@ -216,6 +216,7 @@ const Staking: NextPage = () => { const vestingAccountState = mainStakeAccount.getVestingAccountState(currentTime) setCurrentVestingAccountState(vestingAccountState) + setIsLockButtonDisabled(vestingAccountState != VestingAccountState.FullyVested && vestingAccountState != VestingAccountState.UnvestedTokensFullyLocked) } } @@ -1181,11 +1182,11 @@ const Staking: NextPage = () => { className="primary-btn w-full py-3 px-8 text-base font-semibold text-white hover:bg-blueGemHover disabled:bg-valhalla" onClick={handleDeposit} disabled={ - isVestingAccountWithoutGovernance || + isLockButtonDisabled || !isSufficientBalance } > - {isVestingAccountWithoutGovernance ? ( + {isLockButtonDisabled ? ( Lock @@ -1200,11 +1201,11 @@ const Staking: NextPage = () => { className="primary-btn w-full py-3 px-8 text-base font-semibold text-white hover:bg-blueGemHover disabled:bg-valhalla" onClick={handleUnlock} disabled={ - isVestingAccountWithoutGovernance || + isLockButtonDisabled || !isSufficientBalance } > - {isVestingAccountWithoutGovernance ? ( + {isLockButtonDisabled ? ( Unlock