fix: inherit icon size from text component parent#14024
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14024 +/- ##
==========================================
+ Coverage 63.42% 64.34% +0.91%
==========================================
Files 2093 2171 +78
Lines 45277 46124 +847
Branches 6234 6429 +195
==========================================
+ Hits 28717 29677 +960
+ Misses 14676 14522 -154
- Partials 1884 1925 +41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
david0xd
approved these changes
Mar 14, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Description
On snaps extension, icon size is inherited from the text component parent, on mobile we can't do that. To fix the issue, the
text.tsfile andutils.tsfile have been updated to pass down the text parent size prop into the Icon child if there isn't one present.Related issues
Fixes: MetaMask/snaps#3180
Manual testing steps
Screenshots/Recordings
Before
Icons were default sized 'sm'
After
Screenshots show two different Icons, one rendered within a Text parent with prop
size="sm"and one rendered on it's own with asize="md"prop added. Results show one inherits the text parent size prop and the other refers to it's own size prop.Pre-merge author checklist
Pre-merge reviewer checklist