Notifications in place

This commit is contained in:
James Barnsley
2016-12-13 11:08:13 +13:00
parent b98a360ca3
commit b02bbb3c26
13 changed files with 190 additions and 9 deletions

View File

@ -183,6 +183,13 @@ export function addTracksToPlaylist( playlist_uri, tracks_uris ){
}
}
/**
* Modal
*
* Immersive full-screen dialog
**/
export function openModal( name, data ){
return {
type: 'OPEN_MODAL',
@ -197,3 +204,30 @@ export function closeModal(){
return { type: 'CLOSE_MODAL' }
}
/**
* Notifications
*
* Subtle info/tooltip messages
**/
export function createNotification( content, type = 'default' ){
return {
type: 'CREATE_NOTIFICATION',
notification: {
id: helpers.generateGuid(),
type: type,
content: content
}
}
}
export function removeNotification( id ){
return {
type: 'REMOVE_NOTIFICATION',
id: id
}
}