Files
Iris/src/js/components/ArtistList.js

39 lines
953 B
JavaScript
Raw Normal View History

import React, { PropTypes } from 'react'
import { Link } from 'react-router'
2016-10-25 21:36:33 +13:00
import Thumbnail from './Thumbnail'
export default class ArtistList extends React.Component{
constructor(props) {
2016-11-21 16:54:17 +13:00
super(props)
}
render(){
if( !this.props.artists ) return null
return (
2016-11-04 15:55:17 +13:00
<div className="artist-list">
{
this.props.artists.map( (artist, index) => {
if( artist.uri ){
return (
<Link to={ '/artist/' + artist.uri } key={artist.uri} className="artist">
<Thumbnail circle={true} size="small" images={artist.images} />
<span className="name">{ artist.name }</span>
</Link>
)
}else{
return (
<span key={artist.uri} className="artist">
<Thumbnail circle={true} size="small" images={artist.images} />
<span className="name">{ artist.name }</span>
</span>
)
}
})
}
2016-11-04 15:55:17 +13:00
</div>
);
}
}