Skip to content

Commit

Permalink
Use a default single color for broken NFT image (MystenLabs#8198)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibz1 authored Feb 10, 2023
1 parent f1cf482 commit c7b02a1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions apps/wallet/src/ui/app/components/nft-display/NftImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ const nftImageStyles = cva('overflow-hidden', {
md: 'w-36 h-36',
lg: 'w-44 h-44',
},
backgroundColor: {
'gray-40': 'bg-gray-40',
'placeholder-gradient-01': 'bg-placeholderGradient01',
},
},
compoundVariants: [
{
Expand All @@ -41,7 +37,6 @@ const nftImageStyles = cva('overflow-hidden', {
],
defaultVariants: {
borderRadius: 'md',
backgroundColor: 'placeholder-gradient-01',
},
});

Expand All @@ -61,7 +56,6 @@ export function NftImage({
animateHover,
borderRadius,
size,
backgroundColor,
}: NftImageProps) {
const [error, setError] = useState(false);
const imgCls = cl(
Expand All @@ -77,15 +71,14 @@ export function NftImage({
animateHover,
borderRadius,
size,
backgroundColor,
})}
>
{error ? (
<div
className={cl(
imgCls,
'flex flex-col flex-nowrap items-center justify-center',
'select-none uppercase text-steel-dark gap-2'
'select-none uppercase text-steel-dark gap-2 bg-gray-40'
)}
title={title}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function TxnImage({ id }: { id: string }) {
name={nftMeta.name}
src={nftMeta.url}
/>

<div className="flex flex-col gap-1 justify-center break-all w-56">
{nftMeta.name && (
<Text
Expand Down

0 comments on commit c7b02a1

Please sign in to comment.