Commit 4b978aa
authored
chore: remove Text component wrappers from BottomSheetHeader children (#22173)
## **Description**
Removed `Text` component wrappers from `BottomSheetHeader` children
across the codebase to ensure consistency with the new API pattern where
`BottomSheetHeader` handles text styling internally.
This refactoring removes redundant `Text` components that were wrapping
string content inside `BottomSheetHeader`. The `BottomSheetHeader`
component now handles the text styling directly, ensuring a consistent
appearance across all bottom sheet headers in the app.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Part of: https://consensyssoftware.atlassian.net/browse/MDP-343
## **Manual testing steps**
```gherkin
Feature: Bottom Sheet Headers Display Correctly
Scenario: user views various bottom sheets with headers
Given the app is running
When user opens any bottom sheet modal with a header (e.g., network selector, payment method selector, region selector, account permissions, etc.)
Then the header text should display correctly with proper styling
And the header should be visually consistent with other bottom sheet headers
```
## **Screenshots/Recordings**
### **Before**
N/A - Internal refactoring, no visual changes. We can trust the
component to handle styling correctly.
### **After**
N/A - Internal refactoring, no visual changes. We can trust the
component to handle styling correctly.
## **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**
- [ ] 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.
---
### **Changes Summary**
**11 component files updated:**
- NetworkSettings/index.js (4 instances)
- NetworkListBottomSheet.tsx
- TooltipModal/index.tsx
- AccountPermissionsConfirmRevokeAll.tsx
- NetworkSelector/NetworkSelector.tsx
- RpcSelectionModal/RpcSelectionModal.tsx
- NetworkManager/index.tsx
- PermittedNetworksInfoSheet.tsx
- ConnectionDetails/ConnectionDetails.tsx
- RegionSelectorModal/RegionSelectorModal.tsx
- PaymentMethodSelectorModal.tsx
**5 test snapshots updated:**
- RegionSelectorModal (8 snapshots)
- PaymentMethodSelectorModal (1 snapshot)
- AccountPermissionsConfirmRevokeAll (1 snapshot)
- ConnectionDetails (1 snapshot)
- PermittedNetworksInfoSheet (1 snapshot)
**Total:** 16 files changed, 54 insertions(+), 60 deletions(-)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Refactors BottomSheetHeader to take raw string children across
modals/selectors and updates tests/snapshots and small header style
expectations.
>
> - **UI/BottomSheetHeader refactor**:
> - Replace `<Text>` wrappers with raw string children in
`BottomSheetHeader` across:
> - Bridge: `BlockaidModal`, `BridgeNetworkSelectorBase`,
`BridgeTokenSelectorBase`, `QuoteExpiredModal`, `SlippageModal`,
`TransactionDetails/BlockExplorersModal`.
> - Ramp (Deposit): `PaymentMethodSelectorModal`, `RegionSelectorModal`.
> - Account Permissions: `AccountPermissionsConfirmRevokeAll`,
`ConnectionDetails`, `PermittedNetworksInfoSheet`.
> - Networks: `NetworkManager`, `AddAsset/NetworkListBottomSheet`,
`NetworkSelector`.
> - Misc: `TooltipModal`.
> - **Tests/Snapshots**:
> - Update snapshots to new header structure: add
`testID="header-title"`, center text, and expect fontSize 16.
> - Adjust NetworkManager tests to assert `testID="header"` instead of
mocked header ID; extend icon mocks.
> - **Styles**:
> - Remove unused `heading` style in `NetworkSettings` styles; align
header typography via `BottomSheetHeader`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ddcd7e7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent c930907 commit 4b978aa
File tree
29 files changed
+88
-115
lines changed- app/components
- UI
- Bridge/components
- BlockaidModal
- BridgeDestNetworkSelector/__snapshots__
- BridgeDestTokenSelector/__snapshots__
- BridgeSourceNetworkSelector/__snapshots__
- BridgeSourceTokenSelector/__snapshots__
- QuoteExpiredModal
- __snapshots__
- SlippageModal
- __snapshots__
- TransactionDetails
- NetworkManager
- Ramp/Deposit/Views/Modals
- PaymentMethodSelectorModal
- __snapshots__
- RegionSelectorModal
- __snapshots__
- Views
- AccountPermissions
- AccountPermissionsConfirmRevokeAll
- __snapshots__
- ConnectionDetails
- __snapshots__
- PermittedNetworksInfoSheet
- __snapshots__
- AddAsset/components
- NetworkSelector
- Settings/NetworksSettings/NetworkSettings
- TooltipModal
29 files changed
+88
-115
lines changedLines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | 471 | | |
473 | | - | |
| 472 | + | |
474 | 473 | | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | 477 | | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| |||
Lines changed: 3 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 2 | + | |
| 3 | + | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 10 | | |
20 | 11 | | |
21 | 12 | | |
| |||
34 | 25 | | |
35 | 26 | | |
36 | 27 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 28 | + | |
40 | 29 | | |
41 | 30 | | |
42 | 31 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | 471 | | |
473 | | - | |
| 472 | + | |
474 | 473 | | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | 477 | | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
| 475 | + | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
227 | 226 | | |
228 | 227 | | |
229 | 228 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 229 | + | |
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
0 commit comments