-
Notifications
You must be signed in to change notification settings - Fork 87
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
added useAlert hook to display danger and success alerts #180
added useAlert hook to display danger and success alerts #180
Conversation
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.
Please update the commit message in accordance to our contributing guidelines.
@@ -0,0 +1,112 @@ | |||
import React, { |
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.
Please add appropriate license and copyright header.
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.
Sorry for messing up this pull request. I have made the requested changes in a new pull request kindly review it. #186
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
…dropdown Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Signed-off-by: Aman Dwivedi <[email protected]>
Import errMsg from constants in sendRequest.js Import errMsg from constants in UploadReuse Import errMsg from constants to ErrorPage Rename constants file errorMessages to messages The constants file is supposed to include all message types, so I have renamed the constants file to reflect this. I have also changed the name of the errMsg object to messages. Import messages into Group\Create Import messages into Delete Import messages into Browse Import messages into ScheduleAgents Import messages into Create Import messages into Delete Import messages into Edit Import messages into Move Import messages into Unlink Import messages into License/Create Import messages into Upload/Delete Import messages into Uploads/Move Import messages into Upload/File Import messages into Upload/Url Import messages into Upload/Vcs Add Stevie Gill's email to messages.js Text changes in messages to improve consistency Removed full points and capital letters from some of the strings to improve the consistency of the messages.
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Signed-off-by: Shruti3004 <[email protected]>
Added copy code block on yarn commands and made that section look better Signed-off-by: Devesh <[email protected]>
This pull request has conflicts, please rebase to resolve those before we can evaluate the pull request. |
References to the issues
#157
#155
#154
Description
useAlert hook to display success and danger snackbars. The alert message disappears after 5 seconds or if the user closes the alert message.
Changes
Added an AlertProvider component that provides a useAlert() hook which uses react context under the hood. The hook returns a function alertUser(message,type) which accepts message and type as parameters.
Implementation
The alertUser() is implemented in Pages>Home>index.jsx at line 80 and 88. Other Alerts can be changed to use hooks as well (will do it after the code is reviewed).
Snackbar.mp4