Skip to content

Commit

Permalink
Broken - Work in progress - Added a click on track in dashboard best …
Browse files Browse the repository at this point in the history
…new music
  • Loading branch information
trekiteasy committed Feb 9, 2019
1 parent 9e9a8fc commit b34ce4b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import FontAwesome from 'react-fontawesome';

import styles from './styles.scss';

Expand Down Expand Up @@ -57,6 +58,14 @@ class BestNewListActiveItem extends React.Component {
</div>
</div>);
}

addToQueue (item) {
return this.props.addToQueue(this.props.musicSources, {
artist: item.artist,
name: item.title,
thumbnail: item.thumbnail
});
}
render () {
let { item } = this.props;

Expand All @@ -75,6 +84,23 @@ class BestNewListActiveItem extends React.Component {
{this.renderArtistTitleBox(item)}
</div>
<div />
<div>
{!this.props.albumInfoSearchByName ? <div>
<a
onClick={() => {
this.props.clearQueue();
this.addToQueue(item);
this.props.selectSong(0);
this.props.startPlayback();
}}
href='#'
className={styles.play_button}
>
<FontAwesome name='play' /> Play
</a><a href='#' onClick={() => {
return this.addToQueue(item);
}}><FontAwesome name='plus' /> Add to queue</a></div> : null}
</div>
{this.renderReview(item)}
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/components/Dashboard/BestNewMusicTab/BestNewList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class BestNewList extends React.Component {
item={data[this.state.activeItem]}
artistInfoSearchByName={artistInfoSearchByName}
albumInfoSearchByName={albumInfoSearchByName}
addToQueue={this.props.addToQueue}
selectSong={this.props.selectSong}
clearQueue={this.props.clearQueue}
startPlayback={this.props.startPlayback}
musicSources={this.props.musicSources}
history={history}
/>
</div>
Expand Down
10 changes: 10 additions & 0 deletions app/components/Dashboard/BestNewMusicTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class BestNewMusicTab extends React.Component {
artistInfoSearchByName={artistInfoSearchByName}
albumInfoSearchByName={albumInfoSearchByName}
history={history}
addToQueue={this.props.addToQueue}
selectSong={this.props.selectSong}
clearQueue={this.props.clearQueue}
startPlayback={this.props.startPlayback}
musicSources={this.props.musicSources}
/>
</div>
<h2>
Expand All @@ -42,6 +47,11 @@ class BestNewMusicTab extends React.Component {
data={dashboardData.bestNewTracks}
artistInfoSearchByName={artistInfoSearchByName}
history={history}
addToQueue={this.props.addToQueue}
selectSong={this.props.selectSong}
clearQueue={this.props.clearQueue}
startPlayback={this.props.startPlayback}
musicSources={this.props.musicSources}
/>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/components/Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class Dashboard extends React.Component {
artistInfoSearchByName={this.props.artistInfoSearchByName}
albumInfoSearchByName={this.props.albumInfoSearchByName}
history={this.props.history}
addToQueue={this.props.addToQueue}
selectSong={this.props.selectSong}
clearQueue={this.props.clearQueue}
startPlayback={this.props.startPlayback}
musicSources={this.props.musicSources}
/>
)
},
Expand Down

0 comments on commit b34ce4b

Please sign in to comment.