Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ export class InscriptionApi extends BaseNftApi {
}

private parseInsUrl (id: string, type: string) {
if (type.startsWith('audio/') || type.startsWith('text/html') || type.startsWith('image/svg') || type.startsWith('video/') || type.startsWith('model/gltf')) {
if (type.startsWith('audio/') || type.startsWith('text/html') || type.startsWith('image/svg') || type.startsWith('model/gltf')) {
return this.createIframePreviewUrl(id);
}

if (type.startsWith('video/')) {
return `https://ordinals.com/content/${id}`;
}

if (type.startsWith('text/')) {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,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 All @@ -162,15 +162,16 @@ 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}
/>
)}
{!isInscription && (
{!isBRC20Inscription && (
<Image
className={CN({ clickable: nftItem.externalUrl })}
fallbackSrc={DefaultLogosMap.default_placeholder}
height={358}
modelViewerProps={show3DModel ? { ...DEFAULT_MODEL_VIEWER_PROPS, ...CAMERA_CONTROLS_MODEL_VIEWER_PROPS } : undefined}
onClick={onImageClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props extends ThemeProps {
have3dViewer?: boolean;
}

function Component ({ className = '', fallbackImage, handleOnClick, have3dViewer, image, itemCount, routingParams, title }: Props): React.ReactElement<Props> {
function Component ({ className = '', fallbackImage, handleOnClick, image, itemCount, routingParams, title }: Props): React.ReactElement<Props> {
const { extendToken } = useTheme() as Theme;

const [showImage, setShowImage] = useState(true);
Expand Down Expand Up @@ -98,7 +98,7 @@ function Component ({ className = '', fallbackImage, handleOnClick, have3dViewer
visibleByDefault={true}
/>
);
}, [showImage, showVideo, extendToken.defaultImagePlaceholder, handleImageError, loadingPlaceholder, getCollectionImage, handleVideoError]);
}, [extendToken.defaultImagePlaceholder, getCollectionImage, handleImageError, handleVideoError, loadingPlaceholder, showImage, showVideo]);

return (
<NftItem_
Expand Down