Repository navigation
refactor: use actual svg in networks util package - #426
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactor preserves behavior and is covered by the existing fallback tests.
0 open findings
What changed in this PR
Replaces the shared AssetIcon fallback’s inline SVG constant with a bundled SVG asset.
Changes:
- Adds the question-mark SVG asset.
- Imports it as the fallback icon.
- Updates fallback tests to use the SVG import.
| File | Description |
|---|---|
packages/snap-networks-utils/src/ui/Asset/question-mark.svg |
Adds the fallback icon asset. |
packages/snap-networks-utils/src/ui/Asset/Asset.tsx |
Uses the imported SVG as the fallback. |
packages/snap-networks-utils/src/ui/Asset/Asset.test.tsx |
Updates fallback assertions. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
mikesposito
approved these changes
Oct 8, 2026
Battambang
approved these changes
Oct 8, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Explanation
The shared
Assetcomponent's fallback icon was defined as an inlineQUESTION_MARK_SVGstring constant (600+ characters of SVG markup) inAsset.tsx, because at the time of #418 the library could not bundle.svgimports. #423 fixed that: the library now supports importing.svgfiles as strings, copies them todist/, and ships a Jest transformer for them.This PR switches the fallback to that mechanism:
src/ui/Asset/question-mark.svg(the same question-mark markup as Stellar'ssrc/ui/images/question-mark.svg), colocated with its only consumer.QUESTION_MARK_SVGexport inAsset.tsxwithimport questionMarkIcon from './question-mark.svg', and uses it as theAssetIconfallback.References
Checklist