fix console error

This commit is contained in:
saml33 2023-01-10 10:58:09 +11:00
parent 2168f5ef8a
commit eefd59670d
1 changed files with 25 additions and 27 deletions

View File

@ -329,33 +329,31 @@ function BorrowForm({ onSuccess, token }: BorrowFormProps) {
/>
<div className="flex justify-between">
<p>{t('withdraw-amount')}</p>
<p className="font-mono text-th-fgd-2">
{isBorrow ? (
<AmountWithValue
amount={formatDecimal(
Number(tokenBalance),
bank.mintDecimals
)}
value={formatFixedDecimals(
bank.uiPrice * tokenBalance.toNumber(),
true
)}
/>
) : inputAmount ? (
<AmountWithValue
amount={formatDecimal(
Number(inputAmount),
bank.mintDecimals
)}
value={formatFixedDecimals(
bank.uiPrice * parseFloat(inputAmount),
true
)}
/>
) : (
<AmountWithValue amount="0" value="$0.00" />
)}
</p>
{isBorrow ? (
<AmountWithValue
amount={formatDecimal(
Number(tokenBalance),
bank.mintDecimals
)}
value={formatFixedDecimals(
bank.uiPrice * tokenBalance.toNumber(),
true
)}
/>
) : inputAmount ? (
<AmountWithValue
amount={formatDecimal(
Number(inputAmount),
bank.mintDecimals
)}
value={formatFixedDecimals(
bank.uiPrice * parseFloat(inputAmount),
true
)}
/>
) : (
<AmountWithValue amount="0" value="$0.00" />
)}
</div>
<div className="flex justify-between">
<p>{t('borrow-amount')}</p>