-
Notifications
You must be signed in to change notification settings - Fork 16
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(wallet-dashboard): add grid for visual assets #3758
Conversation
…shboard/add-assets-layout
…shboard/add-assets-layout
apps/wallet-dashboard/app/(protected)/assets/[objectId]/page.tsx apps/wallet-dashboard/app/(protected)/assets/everything-else/page.tsx apps/wallet-dashboard/app/(protected)/assets/visual-assets/[objectId]/page.tsx apps/wallet-dashboard/app/(protected)/assets/visual-assets/page.tsx apps/wallet-dashboard/app/(protected)/components/top-nav/TopNav.tsx apps/wallet-dashboard/app/dashboard/assets/visual-assets/[objectId]/page.tsx
This pull request has been deployed to Vercel. Latest commit: 551b48f ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-d8wifj42c.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 551b48f ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-9xgdclqqh.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 551b48f ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-riht46i97.vercel.app |
This pull request has been deployed to Vercel. Latest commit: a4db526 ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-33amgcgqu.vercel.app |
This pull request has been deployed to Vercel. Latest commit: a4db526 ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-mdb8d913t.vercel.app |
This pull request has been deployed to Vercel. Latest commit: a4db526 ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-ejjkluj06.vercel.app |
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 forgot to actually put the review..
|
||
interface AssetCardProps { | ||
type AssetCardProps = { |
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't you just do something like ?
type AssetCardProps = { | |
interface AssetCardProps extends Pick<VisualAssetCardProps, 'onclick' | 'onIconClick' | 'icon'> { |
asset: IotaObjectData; | ||
flexDirection?: FlexDirection; | ||
} | ||
} & Pick<React.ComponentProps<typeof VisualAssetCard>, 'onClick' | 'onIconClick' | 'icon'>; |
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.
} & Pick<React.ComponentProps<typeof VisualAssetCard>, 'onClick' | 'onIconClick' | 'icon'>; | |
} |
<> | ||
{asset.display && nftMeta && nftMeta.imageUrl && ( | ||
<VisualAssetCard | ||
assetSrc={nftMeta?.imageUrl ?? asset?.display?.data?.imageUrl ?? ''} | ||
assetTitle={nftMeta?.name ?? asset?.display?.data?.name} | ||
assetType={VisualAssetType.Image} | ||
altText={nftMeta?.name ?? (asset?.display?.data?.name || 'NFT')} | ||
isHoverable | ||
icon={icon} | ||
onClick={onClick} | ||
onIconClick={onIconClick} | ||
/> | ||
)} | ||
</> |
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.
simpler, right?
<> | |
{asset.display && nftMeta && nftMeta.imageUrl && ( | |
<VisualAssetCard | |
assetSrc={nftMeta?.imageUrl ?? asset?.display?.data?.imageUrl ?? ''} | |
assetTitle={nftMeta?.name ?? asset?.display?.data?.name} | |
assetType={VisualAssetType.Image} | |
altText={nftMeta?.name ?? (asset?.display?.data?.name || 'NFT')} | |
isHoverable | |
icon={icon} | |
onClick={onClick} | |
onIconClick={onIconClick} | |
/> | |
)} | |
</> | |
if(!asset.display || !nftMeta || !nftMeta.imageUrl){ | |
return null | |
} | |
return ( | |
<VisualAssetCard | |
assetSrc={nftMeta?.imageUrl ?? asset?.display?.data?.imageUrl ?? ''} | |
assetTitle={nftMeta?.name ?? asset?.display?.data?.name} | |
assetType={VisualAssetType.Image} | |
altText={nftMeta?.name ?? (asset?.display?.data?.name || 'NFT')} | |
isHoverable | |
icon={icon} | |
onClick={onClick} | |
onIconClick={onIconClick} | |
/> | |
) |
type={ButtonType.Secondary} | ||
size={ButtonSize.Small} | ||
{...button} | ||
key={index} |
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: simply put the key as the first prop, it behaves the same but its easier to read
type={ButtonType.Secondary} | |
size={ButtonSize.Small} | |
{...button} | |
key={index} | |
key={index} | |
type={ButtonType.Secondary} | |
size={ButtonSize.Small} | |
{...button} |
|
This pull request has been deployed to Vercel. Latest commit: 9c5032e ✅ Preview: https://apps-ui-7e4x6t8dz-iota1.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 9c5032e ✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-5ro8hwc9f.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 9c5032e ✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-qoqdj521b.vercel.app |
This pull request has been deployed to Vercel. Latest commit: 9c5032e ✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-f5kzaqncl.vercel.app |
Fixes #3692
Fixes #3924
Depends on #3724