feat: add support dynamic actions in alert modal#24214
Merged
vinistevam merged 155 commits intodevelopfrom May 22, 2024
Merged
Conversation
…lert-modal-component
…lert-modal-component
…ne-alert-info-row-component
…ne-alert-info-row-component
…al.tsx Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…al.tsx Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…al.test.tsx Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…lert-modal-component
…port-dynamic-actions-alert-modal
…port-dynamic-actions-alert-modal
…port-dynamic-actions-alert-modal
7 tasks
OGPoyraz
reviewed
May 17, 2024
7 tasks
OGPoyraz
approved these changes
May 22, 2024
jpuri
approved these changes
May 22, 2024
Collaborator
Builds ready [6b0e265]
Page Load Metrics (1081 ± 539 ms)
Bundle size diffs
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to include an options property in
Alertscalledactionswhich enables specific actions depending on the alert.Updated
AlertModalcomponent to support displaying suitable buttons based on the alert actions.Created hooks to support the handling of these actions.
Context
Currently, the alert modal components display a single
Got itbutton that is used to close the modal or progress to the next alert in the case of theMultipleAlertModal.In addition to this button, some alerts can define additional actions for the user to carry out, each of which will require an additional button in the alert modal.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2322
Manual testing steps
Those components are currently not in use and are not available to users. It is part of the new alert system, and we will have a dedicated PR to integrate this component into the new confirmation screens.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist