1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Token allowance i18n interpolation system (#16347)

* added i18n interpolation system to token-allowance screen

* modified revokeSpendingCap

* Fixed minor type error

* resolved conflicts
This commit is contained in:
Adnan Sahovic 2022-11-25 11:26:29 +01:00 committed by GitHub
parent 51cffa15dd
commit 6f21c4837d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 16 deletions

View File

@ -3000,7 +3000,8 @@
"description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name" "description": "$1 is either key 'account' or 'contract', and $2 is either a string or link of a given token symbol or name"
}, },
"revokeSpendingCap": { "revokeSpendingCap": {
"message": "Revoke spending cap for your" "message": "Revoke spending cap for your $1",
"description": "$1 is a token symbol"
}, },
"revokeSpendingCapTooltipText": { "revokeSpendingCapTooltipText": {
"message": "This contract will be unable to spend any more of your current or future tokens." "message": "This contract will be unable to spend any more of your current or future tokens."
@ -3190,7 +3191,8 @@
"description": "The token symbol that is being approved" "description": "The token symbol that is being approved"
}, },
"setSpendingCap": { "setSpendingCap": {
"message": "Set a spending cap for your" "message": "Set a spending cap for your $1",
"description": "$1 is a token symbol"
}, },
"settings": { "settings": {
"message": "Settings" "message": "Settings"

View File

@ -187,6 +187,17 @@ export default function TokenAllowance({
const isEmpty = customTokenAmount === ''; const isEmpty = customTokenAmount === '';
const renderContractTokenValues = (
<Box marginTop={4} key={tokenAddress}>
<ContractTokenValues
tokenName={tokenSymbol}
address={tokenAddress}
chainId={fullTxData.chainId}
rpcPrefs={rpcPrefs}
/>
</Box>
);
return ( return (
<Box className="token-allowance-container page-container"> <Box className="token-allowance-container page-container">
<Box <Box
@ -265,26 +276,27 @@ export default function TokenAllowance({
</Typography> </Typography>
</Box> </Box>
</Box> </Box>
<Box marginBottom={5} marginLeft={4} marginRight={4}> <Box marginLeft={4} marginRight={4}>
<Typography <Typography
variant={TYPOGRAPHY.H3} variant={TYPOGRAPHY.H3}
fontWeight={FONT_WEIGHT.BOLD} fontWeight={FONT_WEIGHT.BOLD}
align={TEXT_ALIGN.CENTER} align={TEXT_ALIGN.CENTER}
> >
{isFirstPage && t('setSpendingCap')} {isFirstPage ? (
{!isFirstPage && t('setSpendingCap', [renderContractTokenValues])
(customTokenAmount === '0' || isEmpty ) : (
? t('revokeSpendingCap')
: t('reviewSpendingCap'))}
</Typography>
</Box>
<Box> <Box>
<ContractTokenValues {customTokenAmount === '0' || isEmpty ? (
tokenName={tokenSymbol} t('revokeSpendingCap', [renderContractTokenValues])
address={tokenAddress} ) : (
chainId={fullTxData.chainId} <Box>
rpcPrefs={rpcPrefs} {t('reviewSpendingCap')}
/> {renderContractTokenValues}
</Box>
)}
</Box>
)}
</Typography>
</Box> </Box>
<Box <Box
marginTop={1} marginTop={1}