Skip to content

Instantly share code, notes, and snippets.

@cdaz5
Created May 10, 2018 23:44
Show Gist options
  • Select an option

  • Save cdaz5/4a7f3f3c9244d8f3385e241ad2573e96 to your computer and use it in GitHub Desktop.

Select an option

Save cdaz5/4a7f3f3c9244d8f3385e241ad2573e96 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import logo from './logo.svg';
import './track.css';
class Track extends Component {
constructor(props) {
super(props)
this.addTrack = this.addTrack.bind(this);
}
renderAction() {
if (this.props.isRemoval) {
return <a className="Track-action">-</a>
}
return <a className="Track-action">+</a>;
}
addTrack(event) {
this.props.onAdd(this.props.track);
}
render() {
<div className="Track">
<div className="Track-information">
<h3><!-- track name will go here --></h3>
<p><!-- track artist will go here--> | <!-- track album will go here --></p>
</div>
<a className="Track-action"><!-- + or - will go here --></a>
</div>
<TrackList onAdd = {this.props.onAdd} />
}
}
export default Track;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment