update doNotify and add doHideNotification

This commit is contained in:
Sean Yesmunt 2018-04-19 14:55:37 -04:00
commit c278824b3d
8 changed files with 8641 additions and 34 deletions
src/redux/selectors

View file

@ -2,7 +2,29 @@ import { createSelector } from 'reselect';
export const selectState = state => state.notifications || {};
export const selectNotification = createSelector(
export const selectNotificationData = createSelector(
selectState,
state => (state.queue.length > 0 ? state.queue[0] : {})
);
export const selectNotification = createSelector(
selectNotificationData,
notificationData => notificationData.notification
);
export const selectNotificationProps = createSelector(
selectNotificationData,
notificationData => notificationData.notificationProps
);
export const selectSnack = createSelector(
// No props for snackbar
selectNotification,
notification => {
if (notification && notification.displayType) {
return notification.displayType.indexOf('snackbar') > -1 ? notification : undefined;
}
return undefined;
}
);