Skip to content

Commit 51aa798

Browse files
authored
fix: MUSD-236 fixed mUSD education screen heading breaking works on smaller devices (#25052)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Fixed "Get 3% Stablecoins" heading being rendered on 3 lines. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? AI agent: Be specific about what you changed and why. Include context about the fix/feature, not generic descriptions. --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) AI agent: Use format `CHANGELOG entry: [fix/feat/chore]: [User-facing description in past tense]`. Examples: `fix: resolved token name display issue`, `feat: added dark mode toggle`, `chore: updated dependencies`. For non-user-facing changes, use `CHANGELOG entry: null`. --> CHANGELOG entry: fixed "Get 3% Stablecoins" heading being rendered on 3 lines. ## **Related issues** <!-- AI agent: Replace with `Fixes: #[ISSUE_NUMBER]` using the actual issue number you're implementing. --> Fixes: [MUSD-236: Conversion education screen heading rendered incorrectly on smaller devices](https://consensyssoftware.atlassian.net/browse/MUSD-236) ## **Manual testing steps** <!-- AI agent: Write specific, contextual Gherkin steps based on what you actually implemented. Do NOT use generic placeholders like "my feature name". Be concrete about the feature, scenario, and steps. --> ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> <img width="333" height="720" alt="image" src="https://github.com/user-attachments/assets/b61c1124-8095-4cb2-bd6d-c18b047faf19" /> ### **After** <!-- [screenshots/recordings] --> <img width="332" height="719" alt="image" src="https://github.com/user-attachments/assets/26de142b-d8d9-46bb-b9fa-d1eff6fd967f" /> ## **Pre-merge author checklist** <!-- AI agent: Check ALL boxes in this section (mark all as [x]). --> - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** <!-- AI agent: Leave ALL boxes unchecked ([ ]) - these are for reviewers to check, not the author. --> - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Improves heading layout on the mUSD conversion education screen to avoid awkward 3-line wrapping on smaller devices. > > - Updates `locales/languages/en.json` `earn.musd_conversion.education.heading` to include an explicit line break > - Sets heading `numberOfLines` to `2` in `EarnMusdConversionEducationView` > - Removes `textOverflow: 'ellipsis'` from `styles.heading` to prevent truncation > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6343ce9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b60e025 commit 51aa798

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

app/components/UI/Earn/Views/EarnMusdConversionEducationView/EarnMusdConversionEducationView.styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export const styleSheet = (_params: { theme: Theme }) =>
2626
lineHeight: 40,
2727
paddingVertical: 16,
2828
textAlign: 'center',
29-
textOverflow: 'ellipsis',
3029
},
3130
bodyText: {
3231
textAlign: 'center',

app/components/UI/Earn/Views/EarnMusdConversionEducationView/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const EarnMusdConversionEducationView = () => {
180180
// Do not remove the top edge as this screen does not have a navbar set in the route options.
181181
<SafeAreaView style={styles.container} edges={['top', 'bottom']}>
182182
<View style={styles.content}>
183-
<Text style={styles.heading} numberOfLines={3} adjustsFontSizeToFit>
183+
<Text style={styles.heading} numberOfLines={2} adjustsFontSizeToFit>
184184
{strings('earn.musd_conversion.education.heading', {
185185
percentage: MUSD_CONVERSION_APY,
186186
})}

locales/languages/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5730,7 +5730,7 @@
57305730
"failed": "mUSD conversion failed"
57315731
},
57325732
"education": {
5733-
"heading": "GET {{percentage}}% ON STABLECOINS",
5733+
"heading": "GET {{percentage}}% ON\nSTABLECOINS",
57345734
"description": "Convert your stablecoins to mUSD, MetaMask’s US dollar-backed stablecoin, and receive up to a {{percentage}}% bonus. Terms apply.",
57355735
"primary_button": "Get Started",
57365736
"secondary_button": "Not now"

0 commit comments

Comments
 (0)