Skip to content

Commit

Permalink
fix: display grc721 token uri (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss authored Nov 13, 2024
1 parent a477e1b commit 5acfac2
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export interface NFTCardImageProps {

const NFTCardImage: React.FC<NFTCardImageProps> = ({ isFetched, image, hasBadge = false }) => {
const [hasError, setHasError] = useState(false);
const [loaded, setLoaded] = useState(false);

const handleLoad = (): void => {
setLoaded(true);
};

const handleError = (): void => {
setHasError(true);
Expand All @@ -30,7 +25,7 @@ const NFTCardImage: React.FC<NFTCardImageProps> = ({ isFetched, image, hasBadge
);
}

if (!image || !loaded || hasError) {
if (!image || hasError) {
return (
<NFTCardImageWrapper className='empty'>
<img className='empty-image' src={IconEmptyImage} alt='empty image' />
Expand All @@ -42,8 +37,7 @@ const NFTCardImage: React.FC<NFTCardImageProps> = ({ isFetched, image, hasBadge
<NFTCardImageWrapper>
<img
className='nft-image'
src={image}
onLoad={handleLoad}
src={image || IconEmptyImage}
onError={handleError}
alt='nft image'
/>
Expand Down

0 comments on commit 5acfac2

Please sign in to comment.