more reorganization
This commit is contained in:
31
front-ui/app/components/items/singleItem.js
Normal file
31
front-ui/app/components/items/singleItem.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var React = require('react');
|
||||
var ItemActions = require('../../actions/itemActions');
|
||||
|
||||
var Router = require('react-router');
|
||||
var Navigation = Router.Navigation;
|
||||
|
||||
var SingleItem = React.createClass({
|
||||
mixins: [Navigation],
|
||||
render: function() {
|
||||
var self = this;
|
||||
var itemClick = this.itemClick;
|
||||
var firstImage = this.props.item.get('multi_media_descriptions')[0];
|
||||
firstImage = firstImage || { url: "http://res.cloudinary.com/lfvt7ps2n/image/upload/c_crop,g_center,w_300/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
|
||||
return (
|
||||
<div className="single_item" onClick={itemClick}>
|
||||
<img src={firstImage.url} />
|
||||
<h1> { this.props.item.get('name') }</h1>
|
||||
<div> { this.props.item.get('list_price') } KM </div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
itemClick: function(e) {
|
||||
// no need for this to go through ItemActions
|
||||
//ItemActions.selectItem(this.props.item);
|
||||
this.transitionTo('/artikal/' + this.props.item.get('id') +'/' + this.props.item.get('name'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = SingleItem;
|
||||
Reference in New Issue
Block a user