Updated Toast alerts, progress mvp
• Updated: - Toast alerts
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import {
|
||||
TOAST_TYPE_ERROR,
|
||||
TOAST_TYPE_SUCCESS,
|
||||
} from '../constants'
|
||||
|
||||
export const TOAST_SHOW = 'TOAST_SHOW'
|
||||
export const TOAST_DISMISS = 'TOAST_DISMISS'
|
||||
export const TOAST_CLEAR = 'TOAST_CLEAR'
|
||||
@@ -10,9 +5,9 @@ export const TOAST_CLEAR = 'TOAST_CLEAR'
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export const dismissToast = (alert) => ({
|
||||
export const dismissToast = (toastKey) => ({
|
||||
type: TOAST_DISMISS,
|
||||
alert,
|
||||
toastKey,
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -25,17 +20,8 @@ export const clearToast = () => ({
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export const showToast = (type, message) => ({
|
||||
export const showToast = (toastType, toastData) => ({
|
||||
type: TOAST_SHOW,
|
||||
toastType: type,
|
||||
message,
|
||||
toastType,
|
||||
toastData,
|
||||
})
|
||||
|
||||
export const showToastError = (message) => {
|
||||
return showToast(TOAST_TYPE_ERROR, message)
|
||||
}
|
||||
|
||||
export const showToastSucess = (message) => {
|
||||
console.log("showToastSucess:", message)
|
||||
return showToast(TOAST_TYPE_SUCCESS, message)
|
||||
}
|
||||
Reference in New Issue
Block a user