-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use functional component if methods or lifecycle hooks not needed
- Loading branch information
1 parent
1675908
commit b2b71f3
Showing
5 changed files
with
95 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
import React from 'react'; | ||
import TimeSpanMenu from './TimeSpanMenu'; | ||
|
||
class ListHeader extends React.Component { | ||
render() { | ||
return ( | ||
<header className="section-header"> | ||
<h1 className="section-title">{this.props.title}</h1> | ||
<TimeSpanMenu /> | ||
</header> | ||
); | ||
} | ||
} | ||
const ListHeader = ({ title }) => ( | ||
<header className="section-header"> | ||
<h1 className="section-title">{title}</h1> | ||
<TimeSpanMenu /> | ||
</header> | ||
); | ||
|
||
ListHeader.propTypes = { | ||
title: React.PropTypes.string.isRequired, | ||
} | ||
}; | ||
|
||
export default ListHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import React from 'react'; | ||
import { Link, IndexLink } from 'react-router'; | ||
|
||
export default class Explore extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
const Menu = () => ( | ||
<nav className="menu-outer"> | ||
<div className="menu"> | ||
<IndexLink className="menu-link" activeClassName="active" to="/"> | ||
Recent | ||
</IndexLink> | ||
<Link className="menu-link" activeClassName="active" to="/artists"> | ||
Artists | ||
</Link> | ||
<Link className="menu-link" activeClassName="active" to="/albums"> | ||
Albums | ||
</Link> | ||
<Link className="menu-link" activeClassName="active" to="/tracks"> | ||
Tracks | ||
</Link> | ||
</div> | ||
</nav> | ||
); | ||
|
||
render() { | ||
return ( | ||
<nav className="menu-outer"> | ||
<div className="menu"> | ||
<IndexLink className="menu-link" activeClassName="active" to="/">Recent</IndexLink> | ||
<Link className="menu-link" activeClassName="active" to="/artists">Artists</Link> | ||
<Link className="menu-link" activeClassName="active" to="/albums">Albums</Link> | ||
<Link className="menu-link" activeClassName="active" to="/tracks">Tracks</Link> | ||
</div> | ||
</nav> | ||
); | ||
} | ||
} | ||
export default Menu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router'; | ||
import SineWave from './SineWave'; | ||
|
||
export default class NowPlaying extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
export default ({ track }) => { | ||
const { name, artist } = track; | ||
|
||
render() { | ||
const {name, artist} = this.props.track; | ||
|
||
return ( | ||
<div className="now-playing"> | ||
<h5 className="now-playing-label">Listening:</h5> | ||
<h1 className="now-playing-title">{name}</h1> | ||
<h2 className="now-playing-artist">{artist.name}</h2> | ||
<SineWave/> | ||
</div> | ||
); | ||
} | ||
} | ||
return ( | ||
<div className="now-playing"> | ||
<h5 className="now-playing-label">Listening:</h5> | ||
<h1 className="now-playing-title">{name}</h1> | ||
<h2 className="now-playing-artist">{artist.name}</h2> | ||
<SineWave /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters