From 14509e6c8bafa282d60a5c4c2c81e2f5e7ad9c08 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Wed, 5 Apr 2017 09:16:28 +1200 Subject: [PATCH] Starting cancellable loaders --- src/js/components/Notifications.js | 2 +- src/js/services/ui/actions.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/js/components/Notifications.js b/src/js/components/Notifications.js index c5651660..4b01bf3f 100755 --- a/src/js/components/Notifications.js +++ b/src/js/components/Notifications.js @@ -29,7 +29,7 @@ export default class Notifications extends React.Component{ case 'loading': return (
- this.props.uiActions.removeNotification(notification.id) } /> + this.props.uiActions.cancelLoading(notification.id) } /> { notification.content }
) diff --git a/src/js/services/ui/actions.js b/src/js/services/ui/actions.js index 1cf31157..7ab3ff68 100755 --- a/src/js/services/ui/actions.js +++ b/src/js/services/ui/actions.js @@ -235,7 +235,14 @@ export function createNotification(content, type = 'default', id = helpers.gener } } -export function removeNotification( id ){ +export function cancelLoading(id){ + return { + type: 'CANCEL_LOADING_'+id, + id: id + } +} + +export function removeNotification(id){ return { type: 'REMOVE_NOTIFICATION', id: id