-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add initial structure for Alert System #13382
base: main
Are you sure you want to change the base?
Conversation
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. |
|
setAlertKey, | ||
unconfirmedDangerAlerts, | ||
unconfirmedFieldDangerAlerts, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I am not sure if useMemo above is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @vinistevam
})); | ||
|
||
describe('AlertsContext', () => { | ||
const alert1: Alert = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, would it make sense to rename them dangerAlertMock
warningAlertMock
etc?
[Severity.Warning]: 2, | ||
[Severity.Info]: 1, | ||
}; | ||
return alerts.sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to avoid mutating alerts
array since this is passed by a result of an hook (useConfirmationAlerts
)?
return alerts.sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]); | |
return [...alerts].sort((a, b) => severityOrder[b.severity] - severityOrder[a.severity]); |
|
Description
This PR aims to add the initial structure to support the new alert system.
There are no functional changes at this point.
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2130
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist