Skip to content

Commit

Permalink
fix: settings toggle extra large paddings when biometrics hidden (#10547
Browse files Browse the repository at this point in the history
)

<!--
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**
Updating a fix for this merged
[PR](#10488) for this
[issue](MetaMask/MetaMask-planning#2452). When
the biometrics and/or passcode toggle fields are hidden there is padding
left over which adds more white space into the UI

<!--
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: N/A

## **Manual testing steps**

1. Go to the "Security and Privacy" screen
2. Verify that the toggles now have the correct paddings
3. Verify that when the biometrics and passcode are hidden there isn't
left over padding

## **Screenshots/Recordings**

| Before  | After  |
|:---:|:---:|
| ![Screenshot 2024-08-02 at 12 17
22 PM](https://github.com/user-attachments/assets/6415da38-8b9b-4292-8639-741c49eb8c29)|
![Screenshot 2024-08-02 at 12 17
26 PM](https://github.com/user-attachments/assets/1a009e90-4102-4b75-ae57-536104b69482)
|

### **Before**
N/A

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

### **After**
N/A
<!-- [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
vinnyhoward authored Aug 15, 2024
1 parent ecf506a commit 91d61fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ const LoginOptionsSettings = ({

return (
<View testID={LOGIN_OPTIONS}>
<View style={styles.setting}>
{biometryType ? (
{biometryType ? (
<View style={styles.setting}>
<SecurityOptionToggle
title={strings(`biometrics.enable_${biometryType.toLowerCase()}`)}
value={biometryChoice}
onOptionUpdated={onBiometricsOptionUpdated}
testId={SecurityPrivacyViewSelectorsIDs.BIOMETRICS_TOGGLE}
/>
) : null}
</View>
<View style={styles.setting}>
{biometryType && !biometryChoice ? (
</View>
) : null}
{biometryType && !biometryChoice ? (
<View style={styles.setting}>
<SecurityOptionToggle
title={
Device.isIos()
Expand All @@ -105,8 +105,8 @@ const LoginOptionsSettings = ({
onOptionUpdated={onPasscodeOptionUpdated}
testId={SecurityPrivacyViewSelectorsIDs.DEVICE_PASSCODE_TOGGLE}
/>
) : null}
</View>
</View>
) : null}
</View>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,22 +468,7 @@ exports[`SecuritySettings should render correctly 1`] = `
</View>
<View
testID="login-options"
>
<View
style={
{
"marginTop": 32,
}
}
/>
<View
style={
{
"marginTop": 32,
}
}
/>
</View>
/>
<View
style={
{
Expand Down

0 comments on commit 91d61fb

Please sign in to comment.