Skip to content

Commit ce498e9

Browse files
authored
feat: remove quote details tooltip cta and fix paddings (MetaMask#26156)
<!-- 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** Make TooltipModal CTA optional to prevent rendering the CTA of the tooltip on top of the swaps CTA causing misclicks. <!-- 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: remove quote details tooltip cta and fix paddings ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4129 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="499" height="236" alt="εικόνα" src="https://github.com/user-attachments/assets/cd4e5d5a-a572-4416-b96e-2db674e62935" /> ## **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] > **Low Risk** > Small UI param removal limited to tooltip modal configuration and test updates; low chance of behavioral impact beyond tooltip spacing. > > **Overview** > Bridge `QuoteDetailsCard` no longer passes a hardcoded `bottomPadding` to the tooltip modal for quote rate, network fee, slippage, minimum received, price impact, and rewards tooltips, removing the now-unused `TOOLTIP_BOTTOM_PADDING` constant. > > Associated navigation assertions in `QuoteDetailsCard.test.tsx` were updated to expect tooltip modal params without `bottomPadding`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 00ad73f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5d11a21 commit ce498e9

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

app/components/UI/Bridge/components/QuoteDetailsCard/QuoteDetailsCard.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ describe('QuoteDetailsCard', () => {
489489

490490
expect(mockNavigate).toHaveBeenCalledWith('RootModalFlow', {
491491
params: {
492-
bottomPadding: 64,
493492
title: strings('bridge.network_fee_info_title'),
494493
tooltip: strings('bridge.network_fee_info_content_sponsored', {
495494
nativeToken: 'ETH',
@@ -578,7 +577,6 @@ describe('QuoteDetailsCard', () => {
578577

579578
expect(mockNavigate).toHaveBeenCalledWith('RootModalFlow', {
580579
params: {
581-
bottomPadding: 64,
582580
title: strings('bridge.quote_info_title'),
583581
tooltip: strings('bridge.quote_info_content'),
584582
footerText: undefined,

app/components/UI/Bridge/components/QuoteDetailsCard/QuoteDetailsCard.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ if (
5353
UIManager.setLayoutAnimationEnabledExperimental(true);
5454
}
5555

56-
// Bottom padding for tooltip modals to prevent close button overlapping with Swap button
57-
const TOOLTIP_BOTTOM_PADDING = 64;
58-
5956
const QuoteDetailsCard: React.FC = () => {
6057
const theme = useTheme();
6158
const navigation = useNavigation();
@@ -176,7 +173,6 @@ const QuoteDetailsCard: React.FC = () => {
176173
content: strings('bridge.quote_info_content'),
177174
size: TooltipSizes.Sm,
178175
iconName: IconName.Info,
179-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
180176
},
181177
}}
182178
value={{
@@ -206,7 +202,6 @@ const QuoteDetailsCard: React.FC = () => {
206202
nativeToken: nativeTokenName,
207203
}),
208204
size: TooltipSizes.Sm,
209-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
210205
iconName: IconName.Info,
211206
},
212207
}}
@@ -262,7 +257,6 @@ const QuoteDetailsCard: React.FC = () => {
262257
content: strings('bridge.network_fee_info_content'),
263258
size: TooltipSizes.Sm,
264259
iconName: IconName.Info,
265-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
266260
},
267261
}}
268262
value={{
@@ -287,7 +281,6 @@ const QuoteDetailsCard: React.FC = () => {
287281
content: strings('bridge.slippage_info_description'),
288282
size: TooltipSizes.Sm,
289283
iconName: IconName.Info,
290-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
291284
},
292285
}}
293286
value={{
@@ -327,7 +320,6 @@ const QuoteDetailsCard: React.FC = () => {
327320
content: strings('bridge.minimum_received_tooltip_content'),
328321
size: TooltipSizes.Sm,
329322
iconName: IconName.Info,
330-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
331323
},
332324
}}
333325
value={{
@@ -355,7 +347,6 @@ const QuoteDetailsCard: React.FC = () => {
355347
: strings('bridge.price_impact_info_description'),
356348
size: TooltipSizes.Sm,
357349
iconName: IconName.Info,
358-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
359350
},
360351
}}
361352
value={{
@@ -388,7 +379,6 @@ const QuoteDetailsCard: React.FC = () => {
388379
)}\n\n${strings('bridge.points_tooltip_content_2')}`,
389380
size: TooltipSizes.Sm,
390381
iconName: IconName.Info,
391-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
392382
},
393383
}}
394384
value={{
@@ -426,7 +416,6 @@ const QuoteDetailsCard: React.FC = () => {
426416
content: strings('bridge.points_error_content'),
427417
size: TooltipSizes.Sm,
428418
iconName: IconName.Info,
429-
bottomPadding: TOOLTIP_BOTTOM_PADDING,
430419
},
431420
}),
432421
}}

0 commit comments

Comments
 (0)