-
Notifications
You must be signed in to change notification settings - Fork 11.6k
wallet-ext: support nft standard #9673
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
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.
A small tweak on how we're approaching it. General idea looks good though.
@@ -54,6 +54,10 @@ const textStyles = cva([], { | |||
true: 'truncate', | |||
false: '', | |||
}, | |||
multilineTruncate: { |
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.
Can you just put this on the parent node instead of in the text component?
apps/core/src/utils/nftStandard.ts
Outdated
} | ||
} | ||
|
||
export function processDisplay(display: Record<string, string> | null) { |
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.
We shouldn't use this kind of pattern, given display data can include anything outside of these fields that we'll still display in some contexts. Would rather just handle the display fields piecemeal. This also aligns with our migration away from view-model-like processing of data (which this is closer to).
url: fields.url, | ||
}; | ||
if (!is(details, SuiObjectData) || !details.display) return null; | ||
return processDisplay(details.display); |
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.
If you nuke the processDisplay
from core, you could just move it here basically, since this is already basically a view-model approach to this problem (which is fine for getting this out, just don't want to proliferate it by moving it to core).
import { useQuery, type UseQueryResult } from '@tanstack/react-query'; | ||
|
||
export function useGetObject( | ||
objectId: string | ||
objectId: string, | ||
options?: SuiObjectDataOptions |
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.
Why not just always fetch all the data for the sake of improved cache hits?
@@ -15,7 +15,7 @@ export function useOwnedNFT( | |||
nftObjectId: string | null, | |||
address: SuiAddress | null | |||
) { | |||
const data = useGetObject(nftObjectId!); | |||
const data = useGetObject(nftObjectId || '', { showDisplay: true }); |
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.
I feel like this is easy enough to get wrong that I'd prefer to just get all the data in the hook always.
24566a3
to
db8f944
Compare
@Jordan-Mysten I think I addressed your comments. Please have another look! |
On hover to expand description looks pretty good @pchrysochoidis. Also, following up with you on slack about Object ID, Media Type addition. |
@mystie711 I did the changes and updated the video in the description |
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.
looking good.
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.
Took a brief look, some nits, nothing super concerning, might have someone else take a deeper look
apps/wallet/package.json
Outdated
@@ -57,6 +57,7 @@ | |||
"@storybook/react": "7.0.0-rc.3", | |||
"@storybook/react-webpack5": "7.0.0-rc.3", | |||
"@storybook/theming": "7.0.0-rc.3", | |||
"@tailwindcss/line-clamp": "^0.4.2", |
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.
nit: Should we add this to core?
@@ -15,7 +15,7 @@ export function useOwnedNFT( | |||
nftObjectId: string | null, | |||
address: SuiAddress | null | |||
) { | |||
const data = useGetObject(nftObjectId!); | |||
const data = useGetObject(nftObjectId || ''); |
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 hook doesn't look like it handles nullable object IDs, instead of this defaulting we should update it to handle this properly
|
||
export type LabelValueItemProps = { | ||
label: string; | ||
value: ReactNode | LinkData; |
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.
Never a big fan of this type of variability.
9f037f4
to
5f07fcc
Compare
5f07fcc
to
5dcf800
Compare
* nfts page show only objects that define the display property * removes any other support for nft metadata
5dcf800
to
83d7fb0
Compare
All comments are addressed - dismissing to unblock.
Description
Screen.Recording.2023-03-22.at.01.53.42.mov
Test Plan
manual testing
Type of Change (Check all that apply)
Release notes
Sui wallet now supports NFT display standard. All other display nft metadata support is removed.
closes APPS-633