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

39 lines
980 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 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 (
2016-12-21 15:24:07 +13:00
<Link to={global.baseURL+'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>
);
}
}