Skip to content

Commit

Permalink
fix: ledger sign message screen, legacy account with legacy path will…
Browse files Browse the repository at this point in the history
… push balance information outside the border of screen. (#11550)

<!--
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**
When import a ledger legacy account in Metamask, and user go to click
`Personal Sign` . sometimes the balance is out of border of the personal
sign screen, please see the attached screen image for detail.

This PR fix the layout issue to put the account label below the account
name so that in smaller screen, account balance will not be put out of
box.

<!--
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?
-->

## **Related issues**

Fixes: #11522 

## **Manual testing steps**

1. Install MM
2. Recover from SRP
3. Add Ledger hardware wallet and connect Ledger 2x account
4. Launch MM test dapp
5. Connect Ledger legacy account on test dapp
6. Sign Permit with account

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

![image](https://github.com/user-attachments/assets/1c4173e4-52ad-4304-8306-a0f54bf42ad4)

<!-- [screenshots/recordings] -->

### **After**

![image](https://github.com/user-attachments/assets/84f41566-74ee-4026-83bc-c80f028c7cb8)


![image](https://github.com/user-attachments/assets/117defc2-a45d-4b8c-9110-c0a2007719d8)


<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [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**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
  • Loading branch information
dawnseeker8 authored Oct 16, 2024
1 parent f996de1 commit 3fc95b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const styleSheet = StyleSheet.create({
justifyContent: 'flex-start',
},
accountNameLabelText: {
marginLeft: 4,
paddingHorizontal: 8,
borderWidth: 1,
borderRadius: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ const AccountBase = ({

<View style={styles.accountNameLabel}>
<Text variant={TextVariant.BodyMDBold}>{accountName}</Text>
{accountTypeLabel && (
</View>
{accountTypeLabel && (
<View style={styles.accountNameLabel}>
<Text
variant={TextVariant.BodySM}
variant={TextVariant.BodyMDBold}
style={styles.accountNameLabelText}
>
{strings(accountTypeLabel)}
</Text>
)}
</View>
)}
</View>
</View>
<View>
Expand Down

0 comments on commit 3fc95b2

Please sign in to comment.