Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/address/tokens/AddressCollections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const AddressCollections = ({ collectionsQuery, address, hasActiveFilters }: Pro
</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({
pathname: '/token/[hash]',
query: {
Expand Down
13 changes: 6 additions & 7 deletions ui/shared/EmptySearchResult.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Box, Heading, Text } from '@chakra-ui/react';
import { Box, Heading, Text, Icon } from '@chakra-ui/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 {
text: string | JSX.Element;
Expand All @@ -14,11 +17,7 @@ const EmptySearchResult = ({ text }: Props) => {
flexDirection="column"
alignItems="center"
>
<IconSvg
name="empty_search_result"
boxSize={ 60 }
display="block"
/>
<Icon as={ emptySearchResultIcon } boxSize={ 60 }/>

<Heading
as="h3"
Expand Down
4 changes: 4 additions & 0 deletions ui/token/TokenInventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ const TokenInventory = ({ inventoryQuery, tokenQuery, ownerFilter }: Props) => {
isError={ inventoryQuery.isError }
items={ items }
emptyText="There are no tokens."
filterProps={{
hasActiveFilters: Boolean(ownerFilter),
emptyFilteredText: 'No tokens found for the selected owner.',
}}
content={ content }
actionBar={ actionBar }
/>
Expand Down
Loading