2016-10-03 21:21:14 +13:00
|
|
|
|
|
|
|
|
import React, { PropTypes } from 'react'
|
2016-10-06 16:38:06 +13:00
|
|
|
import FontAwesome from 'react-fontawesome'
|
2016-10-03 21:21:14 +13:00
|
|
|
|
|
|
|
|
export default class Track extends React.Component{
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-06 16:38:06 +13:00
|
|
|
toggleSelected( e ){
|
|
|
|
|
return this.props.toggleSelected();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
playTrack( e ){
|
|
|
|
|
return this.props.playTrack();
|
2016-10-06 09:35:42 +13:00
|
|
|
}
|
|
|
|
|
|
2016-10-03 21:21:14 +13:00
|
|
|
render(){
|
2016-10-06 16:38:06 +13:00
|
|
|
|
|
|
|
|
var selectedIcon = 'square-o';
|
|
|
|
|
if( typeof(this.props.track.selected) !== 'undefined' && this.props.track.selected ){
|
|
|
|
|
selectedIcon = 'check-square-o';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="track" onDoubleClick={ (e) => this.playTrack(e) }>
|
|
|
|
|
<FontAwesome name={selectedIcon} fixedWidth onClick={ (e) => this.toggleSelected(e) } />
|
|
|
|
|
#{this.props.track.uri}: {this.props.track.name}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2016-10-03 21:21:14 +13:00
|
|
|
}
|
|
|
|
|
}
|