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

@@ -10,13 +10,13 @@ const initialState = ImmutableList([])
export default function toasts(state = initialState, action) {
switch(action.type) {
case TOAST_SHOW:
return state.push(ImmutableMap({
return state.set(state.size, ImmutableMap({
key: state.size > 0 ? state.last().get('key') + 1 : 0,
message: action.message,
message: 'action.message',
type: action.toastType,
}))
case TOAST_DISMISS:
return state.filterNot(item => item.get('key') === action.toast.key)
return state.filterNot(item => item.get('key') === action.toastKey)
case TOAST_CLEAR:
return state.clear()
default: