bcmcadam / WereJamming

Spotify API project
1 stars 0 forks source link

TrackList #2

Open mp1pro opened 7 years ago

mp1pro commented 7 years ago

in the TrackList class there is no need to render the list of tracks based on this.props.isRemoval because whether it is true or false we still would like to render a list of tracks. We already used this.props.isRemoval to load each track with a add or minus option in track.js. Hence Tracklist class would be like so:

class TrackList extends React.Component {
  render() {
    return (
      <div className="TrackList">
        {
          this.props.tracks.map(track => {
            return <Track track={track}
                          key={track.id}
                          onAdd={this.props.onAdd}
                          isRemoval={this.props.isRemoval}
                          onRemove={this.props.onRemove} />
          })
        }
      </div>
    );
  }
}