fix/PRO-3588/uniformity-token-image-alt#386
Conversation
WalkthroughReordered an import in AccountModal.tsx and updated the alt text for a token logo image to use the asset’s name instead of symbol. No public or exported API changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying x with
|
| Latest commit: |
803d4fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c396bc7d.x-e62.pages.dev |
| Branch Preview URL: | https://fix-pro-3588-uniformity-toke.x-e62.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/BottomMenuModal/AccountModal.tsx (1)
339-346: Alt text switch to token name is good; add a safe fallback and improve robustnessGood move switching the logo alt from symbol to the token’s human-readable name as per the PR objective. Two follow-ups to harden this area:
- Ensure alt never becomes undefined by falling back to symbol when name is missing.
- Avoid a single failing image hiding all token logos. The current
hideImageboolean is global; if any image errors, all logos are hidden for the entire list. Track this per-asset instead.- Optional UX win: add
loading="lazy"anddecoding="async"to the logo for perf.Proposed inline changes:
- {!hideImage && logoUrl ? ( + {!hiddenLogos[asset.asset.id] && logoUrl ? ( <img src={logoUrl} - alt={asset.asset.name} - onError={() => setHideImage(true)} + alt={asset.asset.name ?? symbol} + loading="lazy" + decoding="async" + onError={() => + setHiddenLogos((prev) => ({ + ...prev, + [asset.asset.id]: true, + })) + } /> ) : ( <div className="h-6 w-6"> <RandomAvatar - name={asset.asset.name} + name={asset.asset.name ?? symbol} isRound variant="marble" /> </div> )}Outside this range, replace the global flag with a per-asset map:
// Replace: const [hideImage, setHideImage] = React.useState(false); // With: const [hiddenLogos, setHiddenLogos] = React.useState<Record<string, boolean>>({});
- If you intentionally want all images to disappear on any error, keep the single boolean and just apply the alt fallback from the diff.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/components/BottomMenuModal/AccountModal.tsx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: lint
- GitHub Check: unit-tests
- GitHub Check: build
🔇 Additional comments (1)
src/components/BottomMenuModal/AccountModal.tsx (1)
37-37: LGTM: import reordering has no functional impactThe moved import stays within the utils block; nothing to flag.
Description
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Summary by CodeRabbit