Skip to content

feat: add quote details card component to Bridge UI #14264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

amitabh94
Copy link
Contributor

@amitabh94 amitabh94 commented Mar 27, 2025

Description

This PR introduces a new QuoteDetailsCard component to enhance the Bridge UI by displaying detailed quote information along with features such as expandable content for price impact and slippage settings, as well as adding relevant tests and updating redux state management.

Key Components Added

1. QuoteDetailsCard

  • Displays essential quote information including:
    • Network fee and estimated processing time
    • Source and destination network details
    • Exchange rate and price impact
    • Slippage settings
  • Features an expandable accordion view for additional details

2. SlippageModal (Updated)

  • Refactored to use Redux for state management

Related issues

Fixes: MMS-1985

Manual testing steps

  1. Navigate to the Bridge screen
  2. Verify the QuoteDetailsCard displays:
  3. Source and destination network badges
  4. Network fee amount
  5. Estimated transaction time
  6. Quote rate
  7. Price impact (when expanded)
  8. Test the expand/collapse functionality
  9. Verify the slippage edit button opens the SlippageModal
  10. Check that the quote info button opens the QuoteInfoModal

Screenshots/Recordings

Bridge_quoteDetails_Card_component.mp4

Pre-merge author checklist

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.

This commit introduces the QuoteInfoModal component, which includes its styles and test cases. The modal displays quote information and allows users to navigate back when the footer or header close button is pressed.
This commit introduces slippage management functionality in the Bridge component. The SlippageModal now utilizes Redux for state management, allowing users to set and apply slippage values. The implementation includes updates to the BridgeView and SlippageModal components, ensuring a seamless user experience. Additionally, tests have been added to verify the new functionality.
This commit introduces the QuoteDetailsCard component to the Bridge UI, enhancing the user experience by displaying detailed quote information. The component includes features such as expandable content for price impact and slippage settings.
Additionally, mock data and tests have been added to ensure functionality and maintainability.
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@amitabh94 amitabh94 changed the title MMS-1985--fe-build-the-quote-card-component-with-mock-data feat: add quote details card component to Bridge UI Mar 27, 2025
@amitabh94 amitabh94 requested a review from Copilot March 27, 2025 04:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new QuoteDetailsCard component to enhance the Bridge UI by displaying detailed quote information along with features such as expandable content for price impact and slippage settings, as well as adding relevant tests and updating redux state management.

  • Added QuoteDetailsCard and its related styles, types, and tests.
  • Updated existing Bridge UI components and redux slices to integrate slippage functionality.
  • Provided new mocks and updated routes for the quote info modal and slippage modal.

Reviewed Changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/components/UI/Bridge/components/QuoteInfoModal/*.tsx Added modal and corresponding tests for displaying quote info.
app/components/UI/Bridge/components/QuoteDetailsCard/*.ts?(x) Introduced QuoteDetailsCard with expandable sections and tests.
app/core/redux/slices/bridge/*.ts Updated redux slice and tests to support slippage state.
app/components/UI/Bridge/index.tsx Integrated QuoteDetailsCard and removed redundant state code.
app/components/UI/Bridge/components/SlippageModal/*.tsx Revised SlippageModal to use redux for updating slippage state.
Other supporting files (mocks, routes) Minor updates and exports to support new modal and component.
Files not reviewed (3)
  • app/components/UI/Bridge/mocks/mock-quotes-native-erc20.json: Language not supported
  • app/components/UI/Bridge/components/QuoteInfoModal/snapshots/QuoteInfoModal.test.tsx.snap: Language not supported
  • locales/languages/en.json: Language not supported

The navigation has been updated to ensure seamless access to the modal from the QuoteDetailsCard component.
@amitabh94 amitabh94 added team-swaps-and-bridge Run Smoke E2E Triggers smoke e2e on Bitrise and removed team-stake labels Mar 27, 2025
Copy link
Contributor

github-actions bot commented Mar 27, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 6248a61
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6804191e-220c-423f-89e7-7dfbcb71a996

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

This update improves the QuoteDetailsCard component by integrating network information display, allowing users to see the source and destination networks for quotes. The component now utilizes Redux selectors for source and destination tokens, ensuring accurate chain ID representation. Additionally, the layout has been adjusted for better responsiveness, and tests have been updated to reflect these changes.
@amitabh94 amitabh94 force-pushed the MMS-1985--fe-build-the-quote-card-component-with-mock-data branch from d7aa8a1 to 19955c1 Compare March 27, 2025 06:01
@amitabh94 amitabh94 marked this pull request as ready for review March 27, 2025 06:06
@amitabh94 amitabh94 requested review from a team as code owners March 27, 2025 06:06
@amitabh94 amitabh94 enabled auto-merge March 27, 2025 06:06
infiniteflower
infiniteflower previously approved these changes Mar 27, 2025
Copy link
Contributor

@infiniteflower infiniteflower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@amitabh94 amitabh94 moved this to Needs dev review in PR review queue Mar 27, 2025
@amitabh94 amitabh94 moved this from Needs dev review to Has approvals, needs CODEOWNER in PR review queue Mar 27, 2025
Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI LGTM! I would suggest getting an approval from other @MetaMask/mobile-devs that are familiar with mocking state 🙏

@amitabh94 amitabh94 added this pull request to the merge queue Mar 27, 2025
@amitabh94 amitabh94 enabled auto-merge March 31, 2025 16:56
@amitabh94 amitabh94 disabled auto-merge March 31, 2025 17:27
@amitabh94 amitabh94 enabled auto-merge March 31, 2025 17:27
@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 31, 2025
Copy link
Contributor

github-actions bot commented Mar 31, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 373a599
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cef2d252-ea67-441a-aa34-1881684d5216

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

infiniteflower
infiniteflower previously approved these changes Mar 31, 2025
@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 31, 2025
Copy link
Contributor

github-actions bot commented Mar 31, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 4a28567
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/39a5ed39-2d5c-4b34-a4e4-c4961eb694a7

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@amitabh94 amitabh94 added this pull request to the merge queue Mar 31, 2025
Merged via the queue into main with commit 9898e1c Mar 31, 2025
41 of 42 checks passed
@amitabh94 amitabh94 deleted the MMS-1985--fe-build-the-quote-card-component-with-mock-data branch March 31, 2025 21:45
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2025
@metamaskbot metamaskbot added the release-7.45.0 Issue or pull request that will be included in release 7.45.0 label Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.45.0 Issue or pull request that will be included in release 7.45.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-swaps-and-bridge
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants