Commit fb7f6cfc authored by tom's avatar tom

fix token inventory skeleton

parent 6015bb72
...@@ -14,6 +14,16 @@ import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip'; ...@@ -14,6 +14,16 @@ import TruncatedTextTooltip from 'ui/shared/TruncatedTextTooltip';
type Props = { item: TokenInstance; isLoading: boolean }; type Props = { item: TokenInstance; isLoading: boolean };
const NFTItem = ({ item, isLoading }: Props) => { const NFTItem = ({ item, isLoading }: Props) => {
const mediaElement = (
<NftMedia
mb="18px"
imageUrl={ item.image_url }
animationUrl={ item.animation_url }
isLoading={ isLoading }
/>
);
return ( return (
<LinkBox <LinkBox
w={{ base: '100%', lg: '210px' }} w={{ base: '100%', lg: '210px' }}
...@@ -21,21 +31,22 @@ const NFTItem = ({ item, isLoading }: Props) => { ...@@ -21,21 +31,22 @@ const NFTItem = ({ item, isLoading }: Props) => {
borderColor={ useColorModeValue('blackAlpha.100', 'whiteAlpha.200') } borderColor={ useColorModeValue('blackAlpha.100', 'whiteAlpha.200') }
borderRadius="12px" borderRadius="12px"
p="10px" p="10px"
_hover={{ boxShadow: 'md' }} _hover={{ boxShadow: isLoading ? 'none' : 'md' }}
fontSize="sm" fontSize="sm"
fontWeight={ 500 } fontWeight={ 500 }
lineHeight="20px" lineHeight="20px"
> >
<NextLink href={{ pathname: '/token/[hash]/instance/[id]', query: { hash: item.token.address, id: item.id } }} passHref legacyBehavior> { isLoading ? mediaElement : (
<LinkOverlay> <NextLink
<NftMedia href={{ pathname: '/token/[hash]/instance/[id]', query: { hash: item.token.address, id: item.id } }}
mb="18px" passHref
imageUrl={ item.image_url } legacyBehavior
animationUrl={ item.animation_url } >
isLoading={ isLoading } <LinkOverlay>
/> { mediaElement }
</LinkOverlay> </LinkOverlay>
</NextLink> </NextLink>
) }
{ item.id && ( { item.id && (
<Flex mb={ 2 } ml={ 1 }> <Flex mb={ 2 } ml={ 1 }>
<Text whiteSpace="pre" variant="secondary">ID# </Text> <Text whiteSpace="pre" variant="secondary">ID# </Text>
...@@ -46,6 +57,7 @@ const NFTItem = ({ item, isLoading }: Props) => { ...@@ -46,6 +57,7 @@ const NFTItem = ({ item, isLoading }: Props) => {
textOverflow="ellipsis" textOverflow="ellipsis"
whiteSpace="nowrap" whiteSpace="nowrap"
display="block" display="block"
isLoading={ isLoading }
> >
{ item.id } { item.id }
</LinkInternal> </LinkInternal>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment