Skip to content

Commit

Permalink
Rename isVestingAccountWithoutGovernance by isLockButtonDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
guibescos committed Jun 7, 2022
1 parent cf2fd28 commit acd15a3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions frontend/pages/staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const Staking: NextPage = () => {
const [isUnlockedModalOpen, setIsUnlockedModalOpen] = useState<boolean>(false)
const [isUnvestedModalOpen, setIsUnvestedModalOpen] = useState<boolean>(false)
const [
isVestingAccountWithoutGovernance,
setIsVestingAccountWithoutGovernance,
isLockButtonDisabled,
setIsLockButtonDisabled,
] = useState<boolean>(false)
const [
multipleStakeAccountsModalOption,
Expand Down Expand Up @@ -216,6 +216,7 @@ const Staking: NextPage = () => {
const vestingAccountState =
mainStakeAccount.getVestingAccountState(currentTime)
setCurrentVestingAccountState(vestingAccountState)
setIsLockButtonDisabled(vestingAccountState != VestingAccountState.FullyVested && vestingAccountState != VestingAccountState.UnvestedTokensFullyLocked)
}
}

Expand Down Expand Up @@ -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 ? (
<Tooltip content="You are currently not enrolled in governance.">
Lock
</Tooltip>
Expand All @@ -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 ? (
<Tooltip content="You are currently not enrolled in governance.">
Unlock
</Tooltip>
Expand Down

0 comments on commit acd15a3

Please sign in to comment.