Skip to content

Commit 41c27cc

Browse files
wip
1 parent 893b6fc commit 41c27cc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/decoded-simulation/decoded-simulation.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ const StateChangeRow = ({
7171
const { assetType, changeType, amount, contractAddress, tokenID } =
7272
stateChange;
7373
const tooltip = getStateChangeToolip(stateChangeList, stateChange, t);
74+
const canDisplayValueAsUnlimited =
75+
assetType === TokenStandard.ERC20 &&
76+
(changeType === DecodingDataChangeType.Approve ||
77+
changeType === DecodingDataChangeType.Revoke);
7478
return (
7579
<ConfirmInfoRow
7680
label={shouldDisplayLabel ? getStateChangeLabelMap(t, changeType) : ''}
@@ -86,6 +90,7 @@ const StateChangeRow = ({
8690
tokenId={tokenID}
8791
credit={changeType === DecodingDataChangeType.Receive}
8892
debit={changeType === DecodingDataChangeType.Transfer}
93+
canDisplayValueAsUnlimited={canDisplayValueAsUnlimited}
8994
/>
9095
)}
9196
{assetType === 'NATIVE' && (

ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/value-display/value-display.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ type PermitSimulationValueDisplayParams = {
5656

5757
/** True if value is being debited to wallet */
5858
debit?: boolean;
59+
60+
/** Wether a large amount can be substituted by "Unlimited" */
61+
canDisplayValueAsUnlimited?: boolean;
5962
};
6063

6164
const PermitSimulationValueDisplay: React.FC<
@@ -68,6 +71,7 @@ const PermitSimulationValueDisplay: React.FC<
6871
value,
6972
credit,
7073
debit,
74+
canDisplayValueAsUnlimited,
7175
}) => {
7276
const t = useI18nContext();
7377

@@ -146,7 +150,7 @@ const PermitSimulationValueDisplay: React.FC<
146150
>
147151
{credit && '+ '}
148152
{debit && '- '}
149-
{shouldShowUnlimitedValue
153+
{canDisplayValueAsUnlimited && shouldShowUnlimitedValue
150154
? t('unlimited')
151155
: tokenValue !== null &&
152156
shortenString(tokenValue || '', {

0 commit comments

Comments
 (0)