Add to playlist extra detail
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
|
||||
import React, { PropTypes } from 'react'
|
||||
import FontAwesome from 'react-fontawesome'
|
||||
import Icon from '../Icon'
|
||||
import * as helpers from '../../helpers'
|
||||
|
||||
@ -22,16 +23,22 @@ export default class AddToPlaylistModal extends React.Component{
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="playlists">
|
||||
{
|
||||
playlists.map( playlist => {
|
||||
return (
|
||||
<div className="playlist" key={playlist.uri} onClick={ () => this.playlistSelected(playlist.uri) }>
|
||||
{ playlist.name }
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
<div>
|
||||
<h4>Add to playlist</h4>
|
||||
<div className="playlists">
|
||||
{
|
||||
playlists.map( playlist => {
|
||||
return (
|
||||
<div className="playlist" key={playlist.uri} onClick={ () => this.playlistSelected(playlist.uri) }>
|
||||
<FontAwesome className="source" name={helpers.sourceIcon(playlist.uri)} />
|
||||
|
||||
<span className="name">{ playlist.name }</span>
|
||||
{ playlist.tracks ? <span className="grey-text"> { playlist.tracks.total } tracks</span> : null }
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ const localstorageMiddleware = (function(){
|
||||
|
||||
// append our state to a global variable. This gives us access to debug the store at any point
|
||||
window._store = store
|
||||
//console.log(action)
|
||||
console.log(action)
|
||||
|
||||
switch( action.type ){
|
||||
|
||||
|
||||
@ -11,8 +11,9 @@ const PusherMiddleware = (function(){
|
||||
const handleMessage = (ws, store, message) => {
|
||||
switch( message.action ){
|
||||
default:
|
||||
var name = message.action.toUpperCase();
|
||||
name = name.replace('GET_','');
|
||||
var name = 'unspecified'
|
||||
if( message.action ) name = message.action
|
||||
name = name.replace('GET_','').toUpperCase()
|
||||
store.dispatch({ type: 'PUSHER_'+name, data: message.data })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user