fix: adds grab mint metadata for ft's (#24496)

* fix: adds grab mint metadata for ft's

* fix: adds unverified tag to tokens from meta

* fix: adds unverified banner
This commit is contained in:
Stella Wang 2022-04-22 00:55:46 -07:00 committed by GitHub
parent 7206f894eb
commit 4793c2c48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 6 deletions

View File

@ -185,14 +185,33 @@ export function AccountHeader({
); );
} }
if (tokenDetails && isToken) { if (isToken) {
let token;
let unverified = false;
if (tokenDetails) {
token = tokenDetails;
} else {
token = {
logoURI: data?.nftData?.json?.image,
name: data?.nftData?.json?.name,
};
unverified = true;
}
return ( return (
<div className="row align-items-end"> <div className="row align-items-end">
{unverified && (
<div className="alert alert-danger alert-scam" role="alert">
Warning! This token uses custom metadata and may have spoofed its
name and logo to look like another token.
</div>
)}
<div className="col-auto"> <div className="col-auto">
<div className="avatar avatar-lg header-avatar-top"> <div className="avatar avatar-lg header-avatar-top">
{tokenDetails?.logoURI ? ( {token?.logoURI ? (
<img <img
src={tokenDetails.logoURI} src={token.logoURI}
alt="token logo" alt="token logo"
className="avatar-img rounded-circle border border-4 border-body" className="avatar-img rounded-circle border border-4 border-body"
/> />
@ -208,9 +227,7 @@ export function AccountHeader({
<div className="col mb-3 ms-n3 ms-md-n2"> <div className="col mb-3 ms-n3 ms-md-n2">
<h6 className="header-pretitle">Token</h6> <h6 className="header-pretitle">Token</h6>
<h2 className="header-title"> <h2 className="header-title">{token?.name || "Unknown Token"}</h2>
{tokenDetails?.name || "Unknown Token"}
</h2>
</div> </div>
</div> </div>
); );