-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using react-tostify to display error toasts
- Loading branch information
1 parent
6b406ec
commit d765f2d
Showing
6 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ToastContainer, toast } from 'react-toastify'; | ||
import 'react-toastify/dist/ReactToastify.css'; | ||
|
||
import React from 'react' | ||
|
||
const notifyError = (message, id, autoClose) => { | ||
toast.error(message, {toastId: id || undefined, autoClose: autoClose !== undefined ? autoClose : 3000} ); | ||
}; | ||
|
||
const ErrorToast = () => { | ||
return ( | ||
<div> | ||
<ToastContainer position='top-center' /> | ||
</div> | ||
) | ||
} | ||
|
||
export {ErrorToast, notifyError} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters