Skip to content

Commit

Permalink
[Issue-202] add condition display in NFT details screen
Browse files Browse the repository at this point in the history
  • Loading branch information
dungnguyen-art committed Jun 26, 2024
1 parent 51c0617 commit 0be73af
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {

const show3DModel = SHOW_3D_MODELS_CHAIN.includes(nftItem.chain);
const ordinalNftItem = nftItem.description && isValidJson(nftItem.description) && JSON.parse(nftItem.description) as OrdinalRemarkData;
const isInscription = useMemo(() => {
const isBRC20Inscription = useMemo(() => {
if (ordinalNftItem && 'p' in ordinalNftItem && 'op' in ordinalNftItem && 'tick' in ordinalNftItem && 'amt' in ordinalNftItem) {
return true;
}
Expand Down Expand Up @@ -195,19 +195,19 @@ function Component ({ className = '' }: Props): React.ReactElement<Props> {
>
<div className={'nft_item_detail__container'}>
<div className={'nft_item_detail__nft_image'}>
{isInscription && nftItem.description && (
{isBRC20Inscription && nftItem.description && (
<InscriptionImage
alone={true}
properties={JSON.parse(nftItem.description) as OrdinalRemarkData}
/>
)}
{isTextPlainInscription && (
{isTextPlainInscription && !isBRC20Inscription && (
<iframe
className={'__nft-text-content'}
src={nftItem.image}
></iframe>
)}
{!(isInscription && nftItem.description) && !isTextPlainInscription && (
{!isBRC20Inscription && !isTextPlainInscription && (
<Image
className={CN({ clickable: nftItem.externalUrl })}
height={358}
Expand Down

0 comments on commit 0be73af

Please sign in to comment.