This commit is contained in:
mgabdev
2020-12-16 02:39:07 -05:00
parent d1ff39bb81
commit 8f94ffad9c
64 changed files with 958 additions and 870 deletions

View File

@@ -5,14 +5,19 @@ import {
} from '../actions/toasts'
import { Map as ImmutableMap, List as ImmutableList } from 'immutable'
const makeMessageFromData = (data) => {
return `${data.type}`.split('_').join(' ').toLowerCase()
}
const initialState = ImmutableList([])
export default function toasts(state = initialState, action) {
switch(action.type) {
case TOAST_SHOW:
console.log("action:", action)
return state.set(state.size, ImmutableMap({
key: state.size > 0 ? state.last().get('key') + 1 : 0,
message: 'action.message',
message: makeMessageFromData(action.toastData),
type: action.toastType,
}))
case TOAST_DISMISS: