I created a system for notifications throughout the react application.
You get two main things from the main file one is a react component which has to be rendered on the top of the stack with given a prop of timeout(time you want to show a notification for) which defaults to 2000ms. Second is a simple javascript function NotificationHandler which can be called from anywhere from the entire app with a data object which would be:-
data = {
message : string,
type : string (options are "success" | "warning" | "error")
}
The color of the notification would be based upon the "type" of the data object. right now the color would be shown as the background of the notification but as we decide what kind of icon library or solution we would be using then in the future only the icon with the associated color and message from the data will be rendered. The demo of the feature is as below.
Fixes #30
Please delete options that are not relevant.
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] This change requires a documentation update
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[x] Manual Testing
[x] Written Tests in Jest
Test Configuration:
Firmware version:
Hardware:
Toolchain: Jest (for react)
SDK:
Checklist:
[ ] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented on my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
Description
I created a system for notifications throughout the react application. You get two main things from the main file one is a react component which has to be rendered on the top of the stack with given a prop of timeout(time you want to show a notification for) which defaults to 2000ms. Second is a simple javascript function NotificationHandler which can be called from anywhere from the entire app with a data object which would be:-
The color of the notification would be based upon the "type" of the data object. right now the color would be shown as the background of the notification but as we decide what kind of icon library or solution we would be using then in the future only the icon with the associated color and message from the data will be rendered. The demo of the feature is as below.
Fixes #30
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: