Starting cancellable loaders

This commit is contained in:
James Barnsley
2017-04-05 09:16:28 +12:00
parent 6bae5c348c
commit 14509e6c8b
2 changed files with 9 additions and 2 deletions

View File

@ -29,7 +29,7 @@ export default class Notifications extends React.Component{
case 'loading':
return (
<div className="loading notification" key={notification.id}>
<FontAwesome name="close" className="close-button" onClick={ e => this.props.uiActions.removeNotification(notification.id) } />
<FontAwesome name="close" className="close-button" onClick={ e => this.props.uiActions.cancelLoading(notification.id) } />
{ notification.content }
</div>
)

View File

@ -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