Skip to content

Commit 50ca0df

Browse files
authored
fix: cp-7.59.0 unconfirmed status styling (#22316)
<!-- 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** This PR fixes styling for "unconfirmed" transaction status <!-- 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: Fixed styling for "unconfirmed" transaction status ## **Related issues** Fixes: #21574 https://consensyssoftware.atlassian.net/browse/TMCU-158 ## **Manual testing steps** ```gherkin Feature: Send BTC Scenario: user sends BTC Given BTC is enabled When user initiates BTC transaction and navigates to Activity tab Then unconfirmed transaction with yellow/orange "Pending" status should appear ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="395" height="835" alt="Screenshot 2025-11-07 at 13 53 14" src="https://github.com/user-attachments/assets/e74b1b50-be28-4800-a1cc-6be00665d119" /> <!-- [screenshots/recordings] --> ### **After** <img width="396" height="833" alt="Screenshot 2025-11-07 at 13 52 51" src="https://github.com/user-attachments/assets/431a522f-0338-4b22-b39a-29d51d03dfca" /> <!-- [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** - [ ] 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] > Maps `Unconfirmed` statuses to pending and enables overriding styles on status text components; updates i18n and snapshots. > > - **UI**: > - `app/components/Base/StatusText.js`: > - `ConfirmedText`, `PendingText`, `FailedText` now accept optional `style` prop merged with base styles. > - Treat `"Unconfirmed"/"unconfirmed"` as pending in `StatusText` switch. > - **i18n**: > - `locales/languages/en.json`: add `"transaction.unconfirmed": "Pending"`. > - **Tests**: > - Update `TransactionDetails` snapshots to reflect array-based `style` merging. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fa44247. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5783dd3 commit 50ca0df

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed

app/components/Base/StatusText.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,50 @@ const styles = StyleSheet.create({
1515
},
1616
});
1717

18-
export const ConfirmedText = ({ testID, ...props }) => (
19-
<Text testID={testID} bold green style={styles.status} {...props} />
18+
export const ConfirmedText = ({ testID, style: styleProp, ...props }) => (
19+
<Text
20+
testID={testID}
21+
bold
22+
green
23+
style={[styles.status, styleProp]}
24+
{...props}
25+
/>
2026
);
2127
ConfirmedText.propTypes = {
2228
testID: PropTypes.string,
29+
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
2330
};
2431

25-
export const PendingText = ({ testID, ...props }) => {
32+
export const PendingText = ({ testID, style: styleProp, ...props }) => {
2633
const { colors } = useTheme();
2734
return (
2835
<Text
2936
testID={testID}
3037
bold
31-
style={[styles.status, { color: colors.warning.default }]}
38+
style={[styles.status, { color: colors.warning.default }, styleProp]}
3239
{...props}
3340
/>
3441
);
3542
};
3643
PendingText.propTypes = {
3744
testID: PropTypes.string,
45+
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
3846
};
3947

40-
export const FailedText = ({ testID, ...props }) => {
48+
export const FailedText = ({ testID, style: styleProp, ...props }) => {
4149
const { colors } = useTheme();
4250
return (
4351
<Text
4452
testID={testID}
4553
bold
46-
style={[styles.status, { color: colors.error.default }]}
54+
style={[styles.status, { color: colors.error.default }, styleProp]}
4755
{...props}
4856
/>
4957
);
5058
};
5159
FailedText.propTypes = {
5260
testID: PropTypes.string,
61+
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
5362
};
5463

5564
function StatusText({ status, context, testID, ...props }) {
@@ -65,6 +74,8 @@ function StatusText({ status, context, testID, ...props }) {
6574
case 'pending':
6675
case 'Submitted':
6776
case 'submitted':
77+
case 'Unconfirmed':
78+
case 'unconfirmed':
6879
case TransactionStatus.signed:
6980
return (
7081
<PendingText testID={testID} {...props}>

app/components/UI/TransactionElement/TransactionDetails/__snapshots__/index.test.tsx.snap

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,14 @@ exports[`TransactionDetails should render correctly 1`] = `
430430
undefined,
431431
undefined,
432432
undefined,
433-
{
434-
"fontSize": 12,
435-
"letterSpacing": 0.5,
436-
"marginTop": 4,
437-
},
433+
[
434+
{
435+
"fontSize": 12,
436+
"letterSpacing": 0.5,
437+
"marginTop": 4,
438+
},
439+
undefined,
440+
],
438441
]
439442
}
440443
>
@@ -1704,11 +1707,14 @@ exports[`TransactionDetails should render correctly for multi-layer fee network
17041707
undefined,
17051708
undefined,
17061709
undefined,
1707-
{
1708-
"fontSize": 12,
1709-
"letterSpacing": 0.5,
1710-
"marginTop": 4,
1711-
},
1710+
[
1711+
{
1712+
"fontSize": 12,
1713+
"letterSpacing": 0.5,
1714+
"marginTop": 4,
1715+
},
1716+
undefined,
1717+
],
17121718
]
17131719
}
17141720
>
@@ -2978,11 +2984,14 @@ exports[`TransactionDetails should render correctly for multi-layer fee network
29782984
undefined,
29792985
undefined,
29802986
undefined,
2981-
{
2982-
"fontSize": 12,
2983-
"letterSpacing": 0.5,
2984-
"marginTop": 4,
2985-
},
2987+
[
2988+
{
2989+
"fontSize": 12,
2990+
"letterSpacing": 0.5,
2991+
"marginTop": 4,
2992+
},
2993+
undefined,
2994+
],
29862995
]
29872996
}
29882997
>

locales/languages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,7 @@
32583258
"failed": "Failed",
32593259
"cancelled": "Cancelled",
32603260
"signed": "Pending",
3261+
"unconfirmed": "Pending",
32613262
"tokenContractAddressWarning_1": "This address is a ",
32623263
"tokenContractAddressWarning_2": "token contract address",
32633264
"tokenContractAddressWarning_3": ". If you send tokens to this address, you will lose them.",

0 commit comments

Comments
 (0)