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,3 +1,4 @@
import isObject from 'lodash.isobject'
import { showLoading, hideLoading } from 'react-redux-loading-bar'
const defaultTypeSuffixes = ['PENDING', 'FULFILLED', 'REJECTED']
@@ -5,8 +6,8 @@ const defaultTypeSuffixes = ['PENDING', 'FULFILLED', 'REJECTED']
export default function loadingBarMiddleware(config = {}) {
const promiseTypeSuffixes = config.promiseTypeSuffixes || defaultTypeSuffixes
return ({ dispatch }) => next => (action) => {
if (action.type && action.type.indexOf('TIMELINE') > -1) {
return ({ dispatch }) => (next) => (action) => {
if (isObject(action) && action.type && action.type.indexOf('TIMELINE') > -1) {
const [PENDING, FULFILLED, REJECTED] = promiseTypeSuffixes
const isPending = new RegExp(`${PENDING}$`, 'g')