FOSSologyUI icon indicating copy to clipboard operation
FOSSologyUI copied to clipboard

feat(alert-hook): added alert hook to display danger and success snac…

Open pushkarsaneja opened this issue 3 years ago • 4 comments

References to the issues

#157 #155 #154 #180

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).

https://user-images.githubusercontent.com/83173777/158048302-0c07cea4-b10c-4468-8f71-c626625ddf1a.mp4

pushkarsaneja avatar Mar 21 '22 23:03 pushkarsaneja

@Shruti3004 @sjha2048 can you please look into this PR?

GMishx avatar May 30 '22 10:05 GMishx

@pushkarsaneja can you please rebase the branch with latest main to resolve the merge conflict?

GMishx avatar May 30 '22 10:05 GMishx

i would like to contribute in this issue. can i solved it?

Rbcoder1 avatar Sep 10 '22 03:09 Rbcoder1

Test is needed for this, fixed merge conflict

viv9k avatar Jan 25 '23 12:01 viv9k