Skip to content
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

Closed
wants to merge 55 commits into from
Closed

added useAlert hook to display danger and success alerts #180

wants to merge 55 commits into from

Conversation

pushkarsaneja
Copy link

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

@GMishx GMishx added needs review Need code review needs test Needs testing labels Mar 21, 2022
Copy link
Member

@GMishx GMishx left a 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, {
Copy link
Member

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.

Copy link
Author

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

Shruti3004 and others added 27 commits March 22, 2022 03:36
Shruti3004 and others added 25 commits March 22, 2022 03:36
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.
Added copy code block on yarn commands and made that section look better

Signed-off-by: Devesh <[email protected]>
@github-actions github-actions bot added the has merge conflicts PR has merge conflicts, require rebase label Mar 21, 2022
@github-actions
Copy link

This pull request has conflicts, please rebase to resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has merge conflicts PR has merge conflicts, require rebase needs review Need code review needs test Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants