Fix invalid header image when transferring NFT (#1813)#1823
Conversation
- Extract NftPreviewView for consistent NFT image display - Show proper NFT preview in recipient scene for NFT transfers - Reuse NftPreviewView in TransactionHeaderView
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where NFT header images were not displayed correctly during transfers. It introduces a new, reusable Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for displaying NFT assets in the recipient scene by refactoring the header view to dynamically show either asset or NFT previews. A new NftPreviewView component was added for reusability, and the TransactionHeaderView was updated to utilize it. Additionally, a new function nftAssetImage was added to RecipientSceneViewModel to generate image assets for NFTs, along with a corresponding test. A review comment suggests an improvement in RecipientSceneViewModel.swift to use the shared instance of AssetImageFormatter for better efficiency.
| func nftAssetImage(for nftAsset: NFTAsset) -> AssetImage { | ||
| AssetImage( | ||
| type: "NFT", | ||
| imageURL: AssetImageFormatter().getNFTUrl(for: nftAsset.id), |
There was a problem hiding this comment.
It is more efficient and idiomatic to use the shared instance of AssetImageFormatter rather than creating a new instance each time nftAssetImage is called. This avoids unnecessary object allocations.
| imageURL: AssetImageFormatter().getNFTUrl(for: nftAsset.id), | |
| imageURL: AssetImageFormatter.shared.getNFTUrl(for: nftAsset.id), |
closes #1813
images:
