-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BeanSama
authored and
BeanSama
committed
Jun 13, 2023
1 parent
297df3e
commit 4b956ee
Showing
2 changed files
with
110 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
projects/ui/src/components/Silo/SiloVestingWarningAlert.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import useFarmerSiloVesting from '~/hooks/farmer/useFarmerSiloVesting'; | ||
import { displayFullBN } from '~/util'; | ||
import WarningAlert from '../Common/Alert/WarningAlert'; | ||
|
||
const SiloVestingWarningAlert: React.FC<{ hide?: boolean }> = ({ | ||
hide = false, | ||
}) => { | ||
const { amount, isVesting, remainingBlocks } = useFarmerSiloVesting(); | ||
|
||
if (!isVesting || hide) return null; | ||
|
||
return ( | ||
<WarningAlert> | ||
{`${ | ||
amount.gte(1) ? displayFullBN(amount, 0) : '<1' | ||
} BEANs are vesting and will be available for plant in ${remainingBlocks} blocks`} | ||
</WarningAlert> | ||
); | ||
}; | ||
|
||
export default SiloVestingWarningAlert; |