disable bond button on incorrect data
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
ff9ca1bb79
commit
650feb01d7
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.7.27",
|
||||
"version": "0.7.28",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -89,6 +89,11 @@ const BondInputArea = ({
|
||||
: bond.capacity.inBaseToken
|
||||
), [bond]);
|
||||
|
||||
const incorrectInputAmount = useMemo(() => {
|
||||
if (!balance) return false;
|
||||
return balance.lt(parsedAmount) || baseTokenString.lt(amountInBaseToken);
|
||||
}, [amountInBaseToken, baseTokenString, balance, parsedAmount]);
|
||||
|
||||
return (
|
||||
<Box minHeight="calc(100vh - 210px)" display="flex" flexDirection="column" justifyContent="center">
|
||||
<Box display="flex" flexDirection="row" width="100%" justifyContent="center" mt="10px">
|
||||
@ -158,7 +163,7 @@ const BondInputArea = ({
|
||||
)}
|
||||
<PrimaryButton
|
||||
fullWidth
|
||||
disabled={bond.isSoldOut || (showDisclaimer && !checked)}
|
||||
disabled={incorrectInputAmount || bond.isSoldOut || (showDisclaimer && !checked)}
|
||||
onClick={() => setConfirmOpen(true)}
|
||||
>
|
||||
Bond
|
||||
|
||||
Loading…
Reference in New Issue
Block a user