1
0
mirror of https://github.com/ascribe/onion.git synced 2024-09-28 12:08:55 +02:00
onion/js/components/edition.js

106 lines
3.3 KiB
JavaScript
Raw Normal View History

import React from 'react';
2015-05-26 13:33:35 +02:00
import ImageViewer from './ascribe_media/image_viewer';
2015-05-26 10:41:41 +02:00
/**
2015-05-26 10:52:20 +02:00
* This is the component that implements display-specific functionality
2015-05-26 10:41:41 +02:00
*/
2015-05-26 13:48:46 +02:00
let Edition = React.createClass({
2015-05-26 13:33:35 +02:00
//propTypes: {
// title: React.PropTypes.string.isRequired
//},
render() {
return (
<div>
<div className="col-md-7">
2015-05-26 13:48:46 +02:00
<ImageViewer thumbnail={this.props.edition.thumbnail}/>
2015-05-26 13:33:35 +02:00
</div>
<div className="col-md-5">
2015-05-26 13:48:46 +02:00
<EditionHeader piece={this.props.edition}/>
<EditionDetails piece={this.props.edition}/>
2015-05-26 13:33:35 +02:00
</div>
</div>
);
}
});
2015-05-26 13:48:46 +02:00
let EditionHeader = React.createClass({
2015-05-26 13:33:35 +02:00
//propTypes: {
// title: React.PropTypes.string.isRequired
//},
render() {
return (
<div className="ascribe-detail-header">
<div className="row">
<div className="row-same-height">
<div className="col-md-2 col-xs-height col-bottom">
<div>TITLE:</div>
</div>
<div className="col-md-10 col-xs-height col-bottom">
2015-05-26 13:48:46 +02:00
<div className="ascribe-detail-title">{this.props.edition.title}</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
</div>
<div className="row">
<div className="col-md-2">
<div>BY:</div>
</div>
<div className="col-md-10">
2015-05-26 13:48:46 +02:00
<div>{this.props.edition.artist_name}</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
<div className="row">
<div className="col-md-2">
<div>DATE:</div>
</div>
<div className="col-md-10">
2015-05-26 13:48:46 +02:00
<div>{ this.props.edition.date_created.slice(0,4) }</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
<hr/>
</div>
);
}
});
2015-05-26 13:48:46 +02:00
let EditionDetails = React.createClass({
2015-05-26 13:33:35 +02:00
//propTypes: {
// title: React.PropTypes.string.isRequired
//},
render() {
return (
<div className="ascribe-detail-header">
<div className="row">
<div className="col-md-2">
<div>EDITION:</div>
</div>
<div className="col-md-10">
2015-05-26 13:48:46 +02:00
<div>{ this.props.edition.edition_number } of {this.props.edition.num_editions}</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
<div className="row">
<div className="col-md-2">
<div>ID:</div>
</div>
<div className="col-md-10">
2015-05-26 13:48:46 +02:00
<div>{ this.props.edition.bitcoin_id }</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
<div className="row">
<div className="col-md-2">
<div>OWNER:</div>
</div>
<div className="col-md-10">
2015-05-26 13:48:46 +02:00
<div>{ this.props.edition.owner }</div>
2015-05-26 13:33:35 +02:00
</div>
</div>
<hr/>
</div>
);
}
});
2015-05-26 13:48:46 +02:00
export default Edition;