mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +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:
parent
51cffa15dd
commit
6f21c4837d
6
app/_locales/en/messages.json
generated
6
app/_locales/en/messages.json
generated
@ -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"
|
||||
},
|
||||
"revokeSpendingCap": {
|
||||
"message": "Revoke spending cap for your"
|
||||
"message": "Revoke spending cap for your $1",
|
||||
"description": "$1 is a token symbol"
|
||||
},
|
||||
"revokeSpendingCapTooltipText": {
|
||||
"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"
|
||||
},
|
||||
"setSpendingCap": {
|
||||
"message": "Set a spending cap for your"
|
||||
"message": "Set a spending cap for your $1",
|
||||
"description": "$1 is a token symbol"
|
||||
},
|
||||
"settings": {
|
||||
"message": "Settings"
|
||||
|
@ -187,6 +187,17 @@ export default function TokenAllowance({
|
||||
|
||||
const isEmpty = customTokenAmount === '';
|
||||
|
||||
const renderContractTokenValues = (
|
||||
<Box marginTop={4} key={tokenAddress}>
|
||||
<ContractTokenValues
|
||||
tokenName={tokenSymbol}
|
||||
address={tokenAddress}
|
||||
chainId={fullTxData.chainId}
|
||||
rpcPrefs={rpcPrefs}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
||||
return (
|
||||
<Box className="token-allowance-container page-container">
|
||||
<Box
|
||||
@ -265,27 +276,28 @@ export default function TokenAllowance({
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box marginBottom={5} marginLeft={4} marginRight={4}>
|
||||
<Box marginLeft={4} marginRight={4}>
|
||||
<Typography
|
||||
variant={TYPOGRAPHY.H3}
|
||||
fontWeight={FONT_WEIGHT.BOLD}
|
||||
align={TEXT_ALIGN.CENTER}
|
||||
>
|
||||
{isFirstPage && t('setSpendingCap')}
|
||||
{!isFirstPage &&
|
||||
(customTokenAmount === '0' || isEmpty
|
||||
? t('revokeSpendingCap')
|
||||
: t('reviewSpendingCap'))}
|
||||
{isFirstPage ? (
|
||||
t('setSpendingCap', [renderContractTokenValues])
|
||||
) : (
|
||||
<Box>
|
||||
{customTokenAmount === '0' || isEmpty ? (
|
||||
t('revokeSpendingCap', [renderContractTokenValues])
|
||||
) : (
|
||||
<Box>
|
||||
{t('reviewSpendingCap')}
|
||||
{renderContractTokenValues}
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box>
|
||||
<ContractTokenValues
|
||||
tokenName={tokenSymbol}
|
||||
address={tokenAddress}
|
||||
chainId={fullTxData.chainId}
|
||||
rpcPrefs={rpcPrefs}
|
||||
/>
|
||||
</Box>
|
||||
<Box
|
||||
marginTop={1}
|
||||
display={DISPLAY.FLEX}
|
||||
|
Loading…
Reference in New Issue
Block a user