|
|
@ -76,7 +76,9 @@ export default function TokenAllowance({ |
|
|
|
|
|
|
|
|
|
|
|
const [showContractDetails, setShowContractDetails] = useState(false); |
|
|
|
const [showContractDetails, setShowContractDetails] = useState(false); |
|
|
|
const [showFullTxDetails, setShowFullTxDetails] = useState(false); |
|
|
|
const [showFullTxDetails, setShowFullTxDetails] = useState(false); |
|
|
|
const [isFirstPage, setIsFirstPage] = useState(true); |
|
|
|
const [isFirstPage, setIsFirstPage] = useState( |
|
|
|
|
|
|
|
dappProposedTokenAmount !== '0', |
|
|
|
|
|
|
|
); |
|
|
|
const [errorText, setErrorText] = useState(''); |
|
|
|
const [errorText, setErrorText] = useState(''); |
|
|
|
|
|
|
|
|
|
|
|
const currentAccount = useSelector(getCurrentAccountWithSendEtherInfo); |
|
|
|
const currentAccount = useSelector(getCurrentAccountWithSendEtherInfo); |
|
|
@ -181,6 +183,8 @@ export default function TokenAllowance({ |
|
|
|
setIsFirstPage(true); |
|
|
|
setIsFirstPage(true); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isEmpty = customTokenAmount === ''; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Box className="token-allowance-container page-container"> |
|
|
|
<Box className="token-allowance-container page-container"> |
|
|
|
<Box |
|
|
|
<Box |
|
|
@ -267,7 +271,7 @@ export default function TokenAllowance({ |
|
|
|
> |
|
|
|
> |
|
|
|
{isFirstPage && t('setSpendingCap')} |
|
|
|
{isFirstPage && t('setSpendingCap')} |
|
|
|
{!isFirstPage && |
|
|
|
{!isFirstPage && |
|
|
|
(customTokenAmount === 0 |
|
|
|
(customTokenAmount === '0' || isEmpty |
|
|
|
? t('revokeSpendingCap') |
|
|
|
? t('revokeSpendingCap') |
|
|
|
: t('reviewSpendingCap'))} |
|
|
|
: t('reviewSpendingCap'))} |
|
|
|
</Typography> |
|
|
|
</Typography> |
|
|
@ -309,7 +313,11 @@ export default function TokenAllowance({ |
|
|
|
<ReviewSpendingCap |
|
|
|
<ReviewSpendingCap |
|
|
|
tokenName={tokenSymbol} |
|
|
|
tokenName={tokenSymbol} |
|
|
|
currentTokenBalance={parseFloat(currentTokenBalance)} |
|
|
|
currentTokenBalance={parseFloat(currentTokenBalance)} |
|
|
|
tokenValue={parseFloat(customTokenAmount)} |
|
|
|
tokenValue={ |
|
|
|
|
|
|
|
isNaN(parseFloat(customTokenAmount)) |
|
|
|
|
|
|
|
? parseFloat(dappProposedTokenAmount) |
|
|
|
|
|
|
|
: parseFloat(customTokenAmount) |
|
|
|
|
|
|
|
} |
|
|
|
onEdit={() => handleBackClick()} |
|
|
|
onEdit={() => handleBackClick()} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|