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(NFT): add nft_id to search bar #317

Merged
merged 14 commits into from Oct 7, 2022

Conversation

shawnxie999
Copy link
Collaborator

@shawnxie999 shawnxie999 commented Sep 12, 2022

High Level Overview of Change

  • Added search support for NFT id by making call to nft_info to check if its NFT (since transactions and nft_id share the same 64-digit hex syntax)
  • Updated a few functions to be async within Search component to support for async API call
  • Updated test cases to support asynchronous operations that would otherwise fail. Used promise flushing(suggested in Provide an API to flush the Promise resolution queue jestjs/jest#2157 (comment))
  • Changed URL for NFTs from token/:id to nft/:id

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

TypeScript/Hooks Update

  • Updated files to React Hooks
  • Updated files to TypeScript

Before / After

image

After clicking Enter
image

Test Plan

@shawnxie999 shawnxie999 requested review from ckniffen and removed request for ckniffen September 12, 2022 21:20
@shawnxie999 shawnxie999 marked this pull request as ready for review September 13, 2022 20:46
await getTransaction(rippledContext, id)
return 'transactions'
} catch (e) {
return 'token'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key for NFTs should really be something like nft or nftoken, instead of using token. It's a different page type.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean we should change the url to something like /nft/:id?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i agree

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i don't like the name of this function with relation to its return type. this name should return a boolean and be named something like isTransaction. Given what this does, it should be named something like determineTypeOfHash

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ledhed2222 soon we will have AMM Instances added to the list of 64 character hexs that we have to determine the type of.

Copy link
Contributor

@ledhed2222 ledhed2222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@shawnxie999 shawnxie999 merged commit 779c6b6 into ripple:staging Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants