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

NFT Details - make it work based on only url params #1750

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

greg-schrammel
Copy link
Contributor

Fixes BX-####
Figma link (if any):

What changed (plus any additional context for devs)

  • makes so NFTDetails route fetch the nft data if we are not routing with state

try opening the bx in this route /home/nft-details/0x529bb7c24fed03ad67b1c69012710c11af019c8c_8453/7879, it should work correctly, before it would be in a broken state

Screen recordings / screenshots

Screen.Recording.2024-10-31.at.06.45.06.mov

What to test

Copy link

linear bot commented Oct 31, 2024

Comment on lines -87 to +99
action: () =>
navigate(
ROUTES.NFT_DETAILS(nft.collection.collection_id || '', nft.id),
),
action: () => {
const [chainName, contractAddress, tokenId] = nft.fullUniqueId.split(
'_',
) as [ChainName, Address, string];
const chainId = chainNameToIdMapping[chainName];
if (!chainId) return;
return navigate(
ROUTES.NFT_DETAILS(`${contractAddress}_${chainId}`, tokenId),
{ state: { nft } },
);
},
Copy link
Member

Choose a reason for hiding this comment

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

Am I missing something or was the fix to just pass nft into state here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol yes,
but since token details work like that I made it the same, this way we can search for nfts the users doesn't own

Copy link
Member

Choose a reason for hiding this comment

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

Do you think there's any value in conditionally fetching the nft if the data doesn't exist? Presumably the data in the details screen is slower to populate now. Would be nice to support this, but use things like the images if we already have them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it shouldn't be slower is it? since we only fetch if we don't have the data, but currently we always have the data

I agree it's was not necessary and will try not to do stuff thinking we may need later like that in the future, I believe we should code what's needed when needed and overcomplicated here thinking of a future case

Copy link
Member

Choose a reason for hiding this comment

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

"but currently we always have the data" <-- I was just checking that that was the case and asking your opinion on conditional fetching. Sounds like you've already thought through it.

"and will try not to do stuff thinking we may need later like that in the future" <-- I think this was a good idea. I appreciate the forethought. I was just asking for some clarification. This change wasn't properly documented.

@DanielSinclair
Copy link
Collaborator

@BrodyHughes Can you QA this? Thank u

Copy link
Member

@BrodyHughes BrodyHughes left a comment

Choose a reason for hiding this comment

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

checked NFT details via tab navigation + cmd K. no regressions and cmd K route now works properly.

@greg-schrammel greg-schrammel merged commit d380406 into master Dec 10, 2024
14 checks passed
@greg-schrammel greg-schrammel deleted the gregs/bx-1600-fix-cmdk-nft-search branch December 10, 2024 04:42
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.

4 participants