Skip to content

Commit

Permalink
hide details in case of scam flag
Browse files Browse the repository at this point in the history
  • Loading branch information
radumojic committed Jul 17, 2024
1 parent bf6d519 commit cc64093
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
22 changes: 10 additions & 12 deletions src/layouts/CollectionLayout/CollectionDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,10 @@ export const CollectionDetailsCard = () => {
}
descriptionContent={
scamInfo ? (
<span className='text-warning d-flex align-items-center ms-2'>
<FontAwesomeIcon
icon={faExclamationTriangle}
size='sm'
className='text-warning me-2'
/>
<div className='d-flex align-items-center flex-wrap gap-2 my-3 text-warning'>
<FontAwesomeIcon icon={faExclamationTriangle} size='sm' />
{scamInfo.info}
</span>
</div>
) : null
}
isVerified={isVerified}
Expand All @@ -93,7 +89,7 @@ export const CollectionDetailsCard = () => {
</Overlay>
}
detailItems={[
assets?.description
assets?.description && !scamInfo
? {
title: 'Description',
value: (
Expand All @@ -106,20 +102,22 @@ export const CollectionDetailsCard = () => {
)
}
: {},
assets?.website
assets?.website && !scamInfo
? {
title: 'Website',
value: <SocialWebsite link={assets.website} />
}
: {},
assets?.social && Object.keys(assets.social).length > 0
assets?.social && Object.keys(assets.social).length > 0 && !scamInfo
? {
title: 'Other Links',
value: <SocialIcons assets={assets.social} excludeWebsite />
}
: {},
{ title: 'Type', value: <NftBadge type={type} /> },
!assets && ticker !== name ? { title: 'Name', value: name } : {},
!scamInfo ? { title: 'Type', value: <NftBadge type={type} /> } : {},
!assets && ticker !== name && !scamInfo
? { title: 'Name', value: name }
: {},
{ title: 'Collection', value: collection },
decimals !== undefined
? {
Expand Down
18 changes: 11 additions & 7 deletions src/layouts/NftLayout/NftDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const NftDetailsCard = () => {
</Overlay>
}
detailItems={[
description
Boolean(description && (!scamInfo || showData))
? {
title: 'Description',
value: (
Expand All @@ -129,7 +129,7 @@ export const NftDetailsCard = () => {
)
}
: {},
hasExtraDescription
hasExtraDescription && (!scamInfo || showData)
? {
title: 'Collection',
value: (
Expand All @@ -142,20 +142,24 @@ export const NftDetailsCard = () => {
)
}
: {},
assets?.website
assets?.website && (!scamInfo || showData)
? {
title: 'Website',
value: <SocialWebsite link={assets.website} />
}
: {},
assets?.social && Object.keys(assets.social).length > 0
assets?.social &&
Object.keys(assets.social).length > 0 &&
(!scamInfo || showData)
? {
title: 'Other Links',
value: <SocialIcons assets={assets.social} excludeWebsite />
}
: {},
{ title: 'Type', value: <NftBadge type={type} /> },
!assets && ticker !== name ? { title: 'Name', value: name } : {},
!assets && ticker !== name && (!scamInfo || showData)
? { title: 'Name', value: name }
: {},
{ title: 'Collection', value: <CollectionBlock nft={nftState} /> },
{ title: 'Identifier', value: identifier },
decimals !== undefined
Expand All @@ -167,12 +171,12 @@ export const NftDetailsCard = () => {
owner !== undefined
? {
title: 'Owner',
value: <AccountLink address={owner} fetchAssets />
value: <AccountLink address={owner} fetchAssets={!scamInfo} />
}
: {},
{
title: 'Creator',
value: <AccountLink address={creator} fetchAssets />
value: <AccountLink address={creator} fetchAssets={!scamInfo} />
},
timestamp !== undefined
? {
Expand Down

0 comments on commit cc64093

Please sign in to comment.