Skip to content

Commit 397796f

Browse files
timi-codesHowardBraham
authored andcommitted
fix(#23072): display ENS in confirmation screen when recipient is added as ENS
1 parent 320f5bf commit 397796f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ui/components/ui/sender-to-recipient/sender-to-recipient.component.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export function RecipientWithAddress({
114114
const [showNicknamePopovers, setShowNicknamePopovers] = useState(false);
115115
const [addressCopied, setAddressCopied] = useState(false);
116116
const petnamesEnabled = usePetnamesEnabled();
117+
const hasRecipientEns = Boolean(recipientEns);
117118

118119
let tooltipHtml = <p>{t('copiedExclamation')}</p>;
119120
if (!addressCopied) {
@@ -152,20 +153,20 @@ export function RecipientWithAddress({
152153
}
153154
}}
154155
>
155-
{!petnamesEnabled && (
156+
{(!petnamesEnabled || hasRecipientEns) && (
156157
<div className="sender-to-recipient__sender-icon">
157158
<Identicon address={checksummedRecipientAddress} diameter={24} />
158159
</div>
159160
)}
160161
<Tooltip
161162
position="bottom"
162-
disabled={!recipientName}
163+
disabled={!recipientName || hasRecipientEns}
163164
html={tooltipHtml}
164165
wrapperClassName="sender-to-recipient__tooltip-wrapper"
165166
containerClassName="sender-to-recipient__tooltip-container"
166167
onHidden={() => setAddressCopied(false)}
167168
>
168-
{petnamesEnabled ? (
169+
{petnamesEnabled && !hasRecipientEns ? (
169170
<Name
170171
value={checksummedRecipientAddress}
171172
type={NameType.ETHEREUM_ADDRESS}
@@ -180,7 +181,8 @@ export function RecipientWithAddress({
180181
)}
181182
</Tooltip>
182183
</div>
183-
{showNicknamePopovers && !petnamesEnabled ? (
184+
{(showNicknamePopovers && !petnamesEnabled) ||
185+
(showNicknamePopovers && hasRecipientEns) ? (
184186
<NicknamePopovers
185187
onClose={() => setShowNicknamePopovers(false)}
186188
address={checksummedRecipientAddress}

0 commit comments

Comments
 (0)