Skip to content

fix: inherit icon size from text component parent#14024

Merged
Daniel-Cross merged 5 commits into
mainfrom
3180-look-into-the-icon-sizing-on-mobile
Mar 14, 2025
Merged

fix: inherit icon size from text component parent#14024
Daniel-Cross merged 5 commits into
mainfrom
3180-look-into-the-icon-sizing-on-mobile

Conversation

@Daniel-Cross

@Daniel-Cross Daniel-Cross commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

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.ts file and utils.ts file 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

  1. Go to this page...

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 a size="md" prop added. Results show one inherits the text parent size prop and the other refers to it's own size prop.

Screenshot 2025-03-14 at 12 35 59

Simulator Screenshot - iPhone 16 Pro - 2025-03-14 at 11 59 28
Simulator Screenshot - iPhone 16 Pro - 2025-03-14 at 11 59 22

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@Daniel-Cross Daniel-Cross added No QA Needed Apply this label when your PR does not need any QA effort. No E2E Smoke Needed team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) labels Mar 14, 2025
@Daniel-Cross Daniel-Cross self-assigned this Mar 14, 2025
@Daniel-Cross Daniel-Cross requested a review from a team as a code owner March 14, 2025 11:46
@Daniel-Cross Daniel-Cross linked an issue Mar 14, 2025 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Mar 14, 2025
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.34%. Comparing base (d1d22d7) to head (a3474f2).
Report is 93 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@Daniel-Cross Daniel-Cross added this pull request to the merge queue Mar 14, 2025
Merged via the queue into main with commit d5bca36 Mar 14, 2025
@Daniel-Cross Daniel-Cross deleted the 3180-look-into-the-icon-sizing-on-mobile branch March 14, 2025 15:13
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 14, 2025
@metamaskbot metamaskbot added the release-7.44.0 Issue or pull request that will be included in release 7.44.0 label Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.44.0 Issue or pull request that will be included in release 7.44.0 team-mobile-platform Mobile Platform team team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Look into the icon sizing on mobile

5 participants