Weening out old full props; Dropzone add to playlist

This commit is contained in:
James Barnsley
2016-11-19 13:06:08 +13:00
parent d8e430858c
commit 96ad8a75c1
18 changed files with 70 additions and 94 deletions

View File

@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux'
import Header from '../../components/Header'
import * as helpers from '../../helpers'
import * as spotifyActions from '../../services/spotify/actions'
class Discover extends React.Component{
@ -13,28 +14,13 @@ class Discover extends React.Component{
super(props);
}
// on render
componentDidMount(){
this.props.spotifyActions.getPlaylist( this.props.params.uri );
}
// when props changed
componentWillReceiveProps( nextProps ){
if( nextProps.params.uri != this.props.params.uri ){
this.props.spotifyActions.getPlaylist( nextProps.params.uri );
}
}
render(){
if( this.props.spotify.playlist ){
return (
<div className="view discover-view">
<Header icon="compass" title="Discover" />
<h1>To come</h1>
</div>
);
}
return null;
return (
<div className="view discover-view">
<Header icon="compass" title="Discover" />
<h1>To come</h1>
</div>
)
}
}
@ -46,7 +32,9 @@ class Discover extends React.Component{
**/
const mapStateToProps = (state, ownProps) => {
return state;
return {
}
}
const mapDispatchToProps = (dispatch) => {