import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import Header from '../../components/Header' import PlaylistGrid from '../../components/PlaylistGrid' import LazyLoadListener from '../../components/LazyLoadListener' import * as spotifyActions from '../../services/spotify/actions' class DiscoverCategory extends React.Component{ constructor(props) { super(props); } componentDidMount(){ this.props.spotifyActions.getCategory( this.props.params.id ); } componentWillReceiveProps( nextProps ){ if( nextProps.params.id != this.props.params.id ){ this.props.spotifyActions.getCategory( nextProps.params.id ); } } loadMore(){ if( !this.props.spotify.new_releases || !this.props.spotify.new_releases.next ) return this.props.spotifyActions.getURL( this.props.spotify.new_releases.next, 'SPOTIFY_NEW_RELEASES_LOADED_MORE' ); } render(){ if( !this.props.spotify.category ) return null; return (