Commit a7424c63 authored by tom's avatar tom

Not possible to remove address filter in token inventory for an address with no NFTs

Fixes #1514
parent 98d3bbcd
...@@ -33,7 +33,7 @@ const AddressCollections = ({ collectionsQuery, address, hasActiveFilters }: Pro ...@@ -33,7 +33,7 @@ const AddressCollections = ({ collectionsQuery, address, hasActiveFilters }: Pro
</ActionBar> </ActionBar>
); );
const content = data?.items ? data?.items.map((item, index) => { const content = data?.items ? data?.items.filter((item) => item.token_instances.length > 0).map((item, index) => {
const collectionUrl = route({ const collectionUrl = route({
pathname: '/token/[hash]', pathname: '/token/[hash]',
query: { query: {
......
import { Box, Heading, Text } from '@chakra-ui/react'; import { Box, Heading, Text, Icon } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import IconSvg from 'ui/shared/IconSvg'; // This icon doesn't work properly when it is in the sprite
// Probably because of radial gradient
// eslint-disable-next-line no-restricted-imports
import emptySearchResultIcon from 'icons/empty_search_result.svg';
interface Props { interface Props {
text: string | JSX.Element; text: string | JSX.Element;
...@@ -14,11 +17,7 @@ const EmptySearchResult = ({ text }: Props) => { ...@@ -14,11 +17,7 @@ const EmptySearchResult = ({ text }: Props) => {
flexDirection="column" flexDirection="column"
alignItems="center" alignItems="center"
> >
<IconSvg <Icon as={ emptySearchResultIcon } boxSize={ 60 }/>
name="empty_search_result"
boxSize={ 60 }
display="block"
/>
<Heading <Heading
as="h3" as="h3"
......
...@@ -83,6 +83,10 @@ const TokenInventory = ({ inventoryQuery, tokenQuery, ownerFilter }: Props) => { ...@@ -83,6 +83,10 @@ const TokenInventory = ({ inventoryQuery, tokenQuery, ownerFilter }: Props) => {
isError={ inventoryQuery.isError } isError={ inventoryQuery.isError }
items={ items } items={ items }
emptyText="There are no tokens." emptyText="There are no tokens."
filterProps={{
hasActiveFilters: Boolean(ownerFilter),
emptyFilteredText: 'No tokens found for the selected owner.',
}}
content={ content } content={ content }
actionBar={ actionBar } actionBar={ actionBar }
/> />
......
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