fix: fixed the UI not being disabled on transaction (#356)
* fix: fixed the UI not being disabled on transaction * fix: borrow modal repay toggle
This commit is contained in:
parent
85bdb4b267
commit
e6926dbd17
@ -130,6 +130,7 @@ export default function AccountFund() {
|
||||
max={BN(balance)}
|
||||
balances={walletBalances}
|
||||
maxText='Max'
|
||||
disabled={isFunding}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
@ -142,6 +143,7 @@ export default function AccountFund() {
|
||||
rightIcon={<Plus />}
|
||||
iconClassName='w-3'
|
||||
onClick={handleSelectAssetsClick}
|
||||
disabled={isFunding}
|
||||
/>
|
||||
<SwitchAutoLend
|
||||
className='pt-4 mt-4 border border-transparent border-t-white/10'
|
||||
|
@ -185,21 +185,25 @@ function BorrowModal(props: Props) {
|
||||
maxText='Max'
|
||||
disabled={isConfirming}
|
||||
/>
|
||||
<Divider className='my-6' />
|
||||
<div className='flex flex-wrap flex-1'>
|
||||
<Text className='w-full mb-1'>Receive funds to Wallet</Text>
|
||||
<Text size='xs' className='text-white/50'>
|
||||
Your borrowed funds will directly go to your wallet
|
||||
</Text>
|
||||
</div>
|
||||
<div className='flex flex-wrap items-center justify-end'>
|
||||
<Switch
|
||||
name='borrow-to-wallet'
|
||||
checked={borrowToWallet}
|
||||
onChange={setBorrowToWallet}
|
||||
disabled={isConfirming}
|
||||
/>
|
||||
</div>
|
||||
{!isRepay && (
|
||||
<>
|
||||
<Divider className='my-6' />
|
||||
<div className='flex flex-wrap flex-1'>
|
||||
<Text className='w-full mb-1'>Receive funds to Wallet</Text>
|
||||
<Text size='xs' className='text-white/50'>
|
||||
Your borrowed funds will directly go to your wallet
|
||||
</Text>
|
||||
</div>
|
||||
<div className='flex flex-wrap items-center justify-end'>
|
||||
<Switch
|
||||
name='borrow-to-wallet'
|
||||
checked={borrowToWallet}
|
||||
onChange={setBorrowToWallet}
|
||||
disabled={isConfirming}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
onClick={onConfirmClick}
|
||||
|
@ -13,8 +13,8 @@ import useStore from 'store'
|
||||
import { BNCoin } from 'types/classes/BNCoin'
|
||||
import { byDenom } from 'utils/array'
|
||||
import { getAssetByDenom, getBaseAsset } from 'utils/assets'
|
||||
import { BN } from 'utils/helpers'
|
||||
import { defaultFee } from 'utils/constants'
|
||||
import { BN } from 'utils/helpers'
|
||||
|
||||
interface Props {
|
||||
account: Account
|
||||
@ -52,7 +52,7 @@ export default function FundAccount(props: Props) {
|
||||
coins: fundingAssets,
|
||||
})
|
||||
setIsFunding(false)
|
||||
if (result) useStore.setState({ focusComponent: null, walletAssetsModal: null })
|
||||
if (result) useStore.setState({ fundAndWithdrawModal: null, walletAssetsModal: null })
|
||||
}, [fundingAssets, accountId, setIsFunding, deposit])
|
||||
|
||||
const handleSelectAssetsClick = useCallback(() => {
|
||||
@ -115,6 +115,7 @@ export default function FundAccount(props: Props) {
|
||||
max={BN(balance)}
|
||||
balances={walletBalances}
|
||||
maxText='Max'
|
||||
disabled={isFunding}
|
||||
className='w-full mb-4'
|
||||
/>
|
||||
)
|
||||
@ -126,6 +127,7 @@ export default function FundAccount(props: Props) {
|
||||
rightIcon={<Plus />}
|
||||
iconClassName='w-3'
|
||||
onClick={handleSelectAssetsClick}
|
||||
disabled={isFunding}
|
||||
/>
|
||||
<SwitchAutoLend
|
||||
className='pt-4 mt-4 border border-transparent border-t-white/10'
|
||||
|
Loading…
Reference in New Issue
Block a user