diff --git a/src/page/CrossChain/index.js b/src/page/CrossChain/index.js index ecb738e..61cb469 100644 --- a/src/page/CrossChain/index.js +++ b/src/page/CrossChain/index.js @@ -551,7 +551,7 @@ class CrossChain extends Component { checkFormDarwiniaToEthereum = (unit = 'ether') => { const { crossChainBalance, crossChainKtonBalance, crossChainBalanceText, recipientAddress, - crossChainKtonBalanceText, ringBalance, ktonBalance } = this.state; + crossChainKtonBalanceText, ringBalance, ktonBalance, crossChainFee } = this.state; const { t } = this.props; @@ -574,7 +574,7 @@ class CrossChain extends Component { return false } - if (crossChainBalance.gt(ringBalance)) { + if ((crossChainBalance.add(crossChainFee).add(Web3.utils.toBN(2000000000))).gt(ringBalance)) { formToast(t(`crosschain:The amount exceeds the account available balance`)) return false } @@ -995,7 +995,7 @@ class CrossChain extends Component { {t('crosschain:Token for cross-chain transfer', { token: 'RING' })} { - this.setValue('crossChainBalance', { target: { value: formatBalance(ringBalance.gte(Web3.utils.toBN(2000000000)) ? ringBalance.sub(Web3.utils.toBN(2000000000)) : Web3.utils.toBN(0), 'gwei') } }, (value) => this.toWeiBNMiddleware(value, 'gwei'), this.setRingBalanceText) + this.setValue('crossChainBalance', { target: { value: formatBalance(ringBalance.gte(Web3.utils.toBN(2000000000).add(crossChainFee)) ? ringBalance.sub(Web3.utils.toBN(2000000000)).sub(crossChainFee) : Web3.utils.toBN(0), 'gwei') } }, (value) => this.toWeiBNMiddleware(value, 'gwei'), this.setRingBalanceText) } } label="RING" inputText={crossChainBalanceText} placeholder={`${t('crosschain:Balance')} : ${formatBalance(ringBalance, 'gwei')} RING`} onChange={(value) => this.setValue('crossChainBalance', value, (value) => this.toWeiBNMiddleware(value, 'gwei'), this.setRingBalanceText)} defaultIsDisable={false}> diff --git a/src/page/CrossChain/style.module.scss b/src/page/CrossChain/style.module.scss index 5324c10..ea19ae8 100644 --- a/src/page/CrossChain/style.module.scss +++ b/src/page/CrossChain/style.module.scss @@ -186,8 +186,9 @@ } .connectAccountBox { - padding: 15px; - margin-bottom: 15px; + padding-top: 15px; + padding-bottom: 15px; + h1 { font-size: 14px; font-weight: normal; @@ -283,7 +284,7 @@ font-weight: normal; flex-grow: 0; flex-shrink: 0; - flex-basis: 100px; + flex-basis: 150px; } p{ word-break: break-all;