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

feat: add searchbar to collectible tabs #5298

Merged
merged 11 commits into from Nov 29, 2022

Conversation

MarkNerdi996
Copy link
Contributor

Summary

This PR adds a togglable Searchbar on the Collectible Tabs, to search the NFTs by their name

Changelog

- adds a togglable Searchbar on the Collectible Tabs
- implement search logic by name

Relevant Issues

Closes #3444

Testing

Platforms

Please select any platforms where your changes have been tested.

  • Desktop
    • MacOS
    • Linux
    • Windows
  • Mobile
    • iOS
    • Android

Instructions

Please describe the specific instructions, configurations, and/or test cases necessary to test and verify that your changes work as intended.

...

Checklist

Please tick all of the following boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or modified tests that prove my changes work as intended
  • I have verified that new and existing unit tests pass locally with my changes
  • I have verified that my latest changes pass CI workflows for testing and linting
  • I have made corresponding changes to the documentation

@MarkNerdi996 MarkNerdi996 added type:feature Adding a new feature or functionality context:wallet stardust Related to the Stardust Protocol labels Nov 28, 2022
@MarkNerdi996 MarkNerdi996 self-assigned this Nov 28, 2022
@MarkNerdi996 MarkNerdi996 linked an issue Nov 28, 2022 that may be closed by this pull request
5 tasks
Copy link
Contributor

@kraftjs kraftjs left a 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))
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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?

Base automatically changed from enhancement/improve-gallery-view-ui to stardust-develop November 29, 2022 13:55
Copy link
Contributor

@kraftjs kraftjs left a 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 🔥

@kraftjs kraftjs merged commit bada79f into stardust-develop Nov 29, 2022
@kraftjs kraftjs deleted the feat/add-nft-search-in-gallery branch November 29, 2022 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context:wallet stardust Related to the Stardust Protocol type:feature Adding a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask]: E12.M2 - Feature: search bar
2 participants