import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import Header from '../../components/Header' import AlbumGrid from '../../components/AlbumGrid' import LazyLoadListener from '../../components/LazyLoadListener' import * as uiActions from '../../services/ui/actions' import * as spotifyActions from '../../services/spotify/actions' class DiscoverNewReleases extends React.Component{ constructor(props) { super(props); } componentDidMount(){ if (!this.props.new_releases) this.props.spotifyActions.getNewReleases(); } loadMore(){ if (!this.props.new_releases_more) return this.props.spotifyActions.getURL(this.props.new_releases_more, 'SPOTIFY_NEW_RELEASES_LOADED'); } render(){ var albums = [] if (this.props.new_releases){ for (var i = 0; i < this.props.new_releases.length; i++){ var uri = this.props.new_releases[i] if (this.props.albums.hasOwnProperty(uri)){ albums.push(this.props.albums[uri]) } } } return (