Created
December 20, 2017 18:10
-
-
Save krescruz/3ac7524a514848032c48993698b32d09 to your computer and use it in GitHub Desktop.
Notify example whit react toastify π
This file contains hidden or 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
import { toast } from 'react-toastify' | |
const POSITION = toast.POSITION.BOTTOM_RIGHT | |
export const saved = (msg) => { | |
const detail = msg || 'Saved successful' | |
toast.success(detail, { position: POSITION }) | |
} | |
export const invalidForm = (msg) => { | |
const detail = msg || 'Invalid or incomplete form' | |
toast.warn(detail, { position: POSITION }) | |
} | |
export const oops = (msg) => { | |
const detail = msg || 'Oops!' | |
toast.error(detail, { position: POSITION }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add more settings from here react-toastify