feat(swap form): disable range input when balance is zero (#333)

This commit is contained in:
Yusuf Seyrek 2023-08-01 10:43:38 +03:00 committed by GitHub
parent 1b34cb77eb
commit fef4608681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ export default function SwapForm(props: Props) {
<RangeInput
wrapperClassName='p-4'
onBlur={dismissInputFocus}
disabled={isTransactionExecuting}
disabled={isTransactionExecuting || accountSellAssetDeposit.isZero()}
onChange={handleRangeInputChange}
value={sellAssetAmount.shiftedBy(-sellAsset.decimals).toNumber()}
max={accountSellAssetDeposit.shiftedBy(-sellAsset.decimals).toNumber()}