Updated Toast alerts, progress mvp

• Updated:
- Toast alerts
This commit is contained in:
mgabdev
2020-12-07 23:39:13 -05:00
parent 5422c013e1
commit 05c5dcb581
28 changed files with 205 additions and 109 deletions

View File

@@ -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)
}