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
feat: add searchbar to collectible tabs #5298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive implementation. Was nice to review your code. Just have 1.5 comments for you to address and then it's ready for approval 😃
nftList = nftList.filter((nft) => nft.name.toLowerCase().includes($nftSearchTerm.toLowerCase())) | ||
} | ||
|
||
return nftList.sort((nft1, nft2) => (nft2.name < nft1.name ? 1 : -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't sort alphabetically; it's sorted by unicode value. "NFT" is placed before "application". It's not an issue but we should figure out how we want to default sort the NFTs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thats true, i'll change this to nft2.name.toLowercase() < nft1.name.toLowercase()
<div class="flex flex-row justify-between"> | ||
<div class="flex flex-row text-left space-x-1 items-center"> | ||
<Text fontSize="text-14" fontWeight={FontWeight.semibold}>{localize('views.collectibles.gallery.title')}</Text> | ||
<Text fontSize="text-14" fontWeight={FontWeight.semibold} color="gray-500">• {$selectedAccountNfts.length}</Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to show $selectedAccountNfts.length
or do we want to show the number of returned NFTs from the search, so $queriedNfts.length
?
…nft-search-in-gallery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved now, thanks for addressing comments 🔥
Summary
This PR adds a togglable Searchbar on the Collectible Tabs, to search the NFTs by their name
Changelog
Relevant Issues
Closes #3444
Testing
Platforms
Instructions
...
Checklist