Commit b377066
authored
feat: MUSD-128 conditionally render bridge-time-row based on transaction type (MetaMask#23552)
<!--
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**
Add conditional rendering of `bridge-time-row` based on transaction
type. For mUSD conversion we want the time estimate hidden.
<!--
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?
-->
## **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)
-->
CHANGELOG entry: add conditional rendering of bridge-time-row by tx type
## **Related issues**
Fixes: [MUSD-128: Hide "estimated time" from quote
screen](https://consensyssoftware.atlassian.net/browse/MUSD-128)
## **Manual testing steps**
```gherkin
Feature: Bridge Time Row Visibility
Scenario: user views confirmation for mUSD conversion transaction
Given the user is on the confirmation screen for a mUSD conversion transaction
When the user views the transaction details
Then the bridge estimated time row is not displayed
Scenario: user views loading state for mUSD conversion transaction
Given the user is on the confirmation screen for a mUSD conversion transaction
And the bridge quotes are loading
When the user views the transaction details
Then the bridge time skeleton loader is not displayed
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
Time estimate is displayed
https://github.com/user-attachments/assets/f910fd34-4f1f-4ca0-b831-159d3c8fa04a
### **After**
<!-- [screenshots/recordings] -->
Time estimate is hidden
https://github.com/user-attachments/assets/3a6d593e-98e2-467f-996c-91421e39996c
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Conditionally hides the bridge estimated time row and skeleton for
`musdConversion` transactions.
>
> - **Confirmations UI**:
> - Add conditional rendering in `bridge-time-row.tsx` to hide time
estimate and skeleton when transaction type matches
`TransactionType.musdConversion` via `hasTransactionType` and
`HIDE_TYPES`.
> - Preserve existing behavior (show skeleton when loading, show
estimate when quotes exist) for other transaction types; keep same-chain
display as `< 10 sec`.
> - **Tests**:
> - Update `bridge-time-row.test.tsx` to support injecting transaction
`type` and add cases asserting no skeleton/estimate for
`musdConversion`.
> - Retain and verify existing duration formatting and same-chain logic.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ca077f9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent aeb8a38 commit b377066
2 files changed
Lines changed: 38 additions & 4 deletions
File tree
- app/components/Views/confirmations/components/rows/bridge-time-row
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
79 | | - | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
| |||
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
96 | 123 | | |
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
0 commit comments