Skip to content

Commit 032f65f

Browse files
authored
chore(runway): cherry-pick fix: cp-7.47.0 don't show currency value unless amount is above zero (#15816)
- fix: cp-7.47.0 don't show currency value unless amount is above zero (#15798) <!-- 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** Prevents the display of the input token's currency value until the user has input an amount >0. <!-- 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: ## **Manual testing steps** 1. Go to bridge 2. See no currency value beneath source token amount input 3. Input amount >0 4. See currency value ## **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/5c383611-cd71-4f2d-8898-da80532be1fb) <!-- [screenshots/recordings] --> ### **After** <img width="361" alt="Screenshot 2025-05-28 at 15 33 02" src="https://github.com/user-attachments/assets/35179b05-351e-4a4e-a780-f40b191490c7" /> <!-- [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. [858d71f](858d71f)
2 parents 8aa529d + 8384b0f commit 032f65f

3 files changed

Lines changed: 49 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
- fix(bridge): don't show currency value unless amount is above zero ([#15798](https://github.com/MetaMask/metamask-mobile/pull/15798))
910

1011

1112
## [7.47.0]

app/components/UI/Bridge/Views/BridgeView/__snapshots__/BridgeView.test.tsx.snap

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -633,21 +633,16 @@ exports[`BridgeView Bottom Content blurs input when opening QuoteExpiredModal 1`
633633
]
634634
}
635635
>
636-
<Text
637-
accessibilityRole="text"
636+
<View
638637
style={
639-
{
640-
"color": "#686e7d",
641-
"fontFamily": "CentraNo1-Book",
642-
"fontSize": 16,
643-
"fontWeight": "400",
644-
"letterSpacing": 0,
645-
"lineHeight": 24,
646-
}
638+
[
639+
{},
640+
{
641+
"flex": 1,
642+
},
643+
]
647644
}
648-
>
649-
$0
650-
</Text>
645+
/>
651646
<Text
652647
accessibilityRole="text"
653648
style={
@@ -857,7 +852,18 @@ exports[`BridgeView Bottom Content blurs input when opening QuoteExpiredModal 1`
857852
},
858853
]
859854
}
860-
/>
855+
>
856+
<View
857+
style={
858+
[
859+
{},
860+
{
861+
"flex": 1,
862+
},
863+
]
864+
}
865+
/>
866+
</View>
861867
</View>
862868
</View>
863869
</View>
@@ -1593,21 +1599,16 @@ exports[`BridgeView renders 1`] = `
15931599
]
15941600
}
15951601
>
1596-
<Text
1597-
accessibilityRole="text"
1602+
<View
15981603
style={
1599-
{
1600-
"color": "#686e7d",
1601-
"fontFamily": "CentraNo1-Book",
1602-
"fontSize": 16,
1603-
"fontWeight": "400",
1604-
"letterSpacing": 0,
1605-
"lineHeight": 24,
1606-
}
1604+
[
1605+
{},
1606+
{
1607+
"flex": 1,
1608+
},
1609+
]
16071610
}
1608-
>
1609-
$0
1610-
</Text>
1611+
/>
16111612
<Text
16121613
accessibilityRole="text"
16131614
style={
@@ -1817,7 +1818,18 @@ exports[`BridgeView renders 1`] = `
18171818
},
18181819
]
18191820
}
1820-
/>
1821+
>
1822+
<View
1823+
style={
1824+
[
1825+
{},
1826+
{
1827+
"flex": 1,
1828+
},
1829+
]
1830+
}
1831+
/>
1832+
</View>
18211833
</View>
18221834
</View>
18231835
</View>

app/components/UI/Bridge/components/TokenInputArea/index.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ const createStyles = ({ vars }: { vars: { fontSize: number } }) =>
7070
height: 50,
7171
fontSize: vars.fontSize,
7272
},
73+
currencyContainer: {
74+
flex: 1,
75+
},
7376
});
7477

7578
export enum TokenInputAreaType {
@@ -267,9 +270,11 @@ export const TokenInputArea = forwardRef<
267270
<Skeleton width={80} height={24} />
268271
) : (
269272
<>
270-
{token && currencyValue ? (
271-
<Text color={TextColor.Alternative}>{currencyValue}</Text>
272-
) : null}
273+
<Box style={styles.currencyContainer}>
274+
{token && amount && Number(amount) > 0 && currencyValue ? (
275+
<Text color={TextColor.Alternative}>{currencyValue}</Text>
276+
) : null}
277+
</Box>
273278
{subtitle ? (
274279
<Text
275280
color={

0 commit comments

Comments
 (0)