import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import TrackList from '../components/TrackList' import AlbumGrid from '../components/AlbumGrid' import * as spotifyActions from '../services/spotify/actions' class Artist extends React.Component{ constructor(props) { super(props); } // on render componentDidMount(){ this.props.spotifyActions.loadArtist( this.props.params.uri ); } // when props changed componentWillReceiveProps( nextProps ){ if( nextProps.params.uri != this.props.params.uri ){ this.props.spotifyActions.loadArtist( nextProps.params.uri ); } } render(){ if( this.props.spotify.artist ){ return (
{ this.props.spotify.artist.followers.total.toLocaleString() } followers
{ this.props.spotify.artist_top_tracks ?