2016-07-07 23:23:18 +02:00
|
|
|
import React, { Component, PropTypes } from "react";
|
|
|
|
|
|
|
|
import { AlbumRow } from "./Album";
|
|
|
|
|
|
|
|
export default class Artist extends Component {
|
|
|
|
render () {
|
|
|
|
var albumsRows = [];
|
|
|
|
if (Array.isArray(this.props.artist.albums)) {
|
|
|
|
this.props.artist.albums.forEach(function (item) {
|
|
|
|
albumsRows.push(<AlbumRow album={item} key={item.id} />);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<div>
|
2016-07-27 13:51:30 +02:00
|
|
|
<div className="row artistNameRow">
|
|
|
|
<div className="col-sm-12">
|
|
|
|
<h1>{this.props.artist.name}</h1>
|
2016-07-07 23:23:18 +02:00
|
|
|
<hr/>
|
2016-07-27 13:51:30 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-sm-9">
|
2016-07-07 23:23:18 +02:00
|
|
|
<p>{this.props.artist.summary}</p>
|
|
|
|
</div>
|
2016-07-27 13:51:30 +02:00
|
|
|
<div className="col-sm-3 text-center">
|
2016-07-26 21:06:28 +02:00
|
|
|
<p><img src={this.props.artist.art} width="200" height="200" className="img-responsive img-circle art" alt={this.props.artist.name}/></p>
|
2016-07-07 23:23:18 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{ albumsRows }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Artist.propTypes = {
|
|
|
|
artist: PropTypes.object.isRequired
|
|
|
|
};
|