Files
Iris/src/js/components/RelatedArtists.js

39 lines
971 B
JavaScript
Raw Normal View History

import React, { PropTypes } from 'react'
2016-10-25 21:36:33 +13:00
import Thumbnail from './Thumbnail'
import URILink from './URILink'
export default class RelatedArtists extends React.Component{
2017-10-10 13:05:28 +13:00
constructor(props){
2016-11-21 16:54:17 +13:00
super(props)
}
render(){
2017-10-10 13:05:28 +13:00
if (!this.props.artists ) return null
return (
<div className="list related-artist-list">
{
2017-10-10 13:05:28 +13:00
this.props.artists.map((artist, index) => {
if (artist.uri){
return (
<URILink type="artist" uri={artist.uri} key={artist.uri} className="artist">
<Thumbnail circle={true} size="small" images={artist.images} />
<span className="name">{ artist.name }</span>
</URILink>
)
} 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>
);
}
}