now displaying traits on item details page
This commit is contained in:
BIN
back-office/public/.DS_Store
vendored
Normal file
BIN
back-office/public/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
front-ui/app/.DS_Store
vendored
BIN
front-ui/app/.DS_Store
vendored
Binary file not shown.
BIN
front-ui/app/components/items/.DS_Store
vendored
BIN
front-ui/app/components/items/.DS_Store
vendored
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
var React = require('react'),
|
||||
Carousel = require('../shared/carousel'),
|
||||
Traits = require('../items/traits'),
|
||||
ItemDetailsActions = require('../../actions/itemDetailsActions'),
|
||||
NavigationStore = require('../../stores/navigationStore'),
|
||||
ItemDetailsStore = require('../../stores/itemDetailsStore');
|
||||
@@ -12,32 +13,26 @@ var ItemWithDetailsPage = React.createClass({
|
||||
render: function() {
|
||||
|
||||
return (
|
||||
|
||||
|
||||
<div className="item-with-details row-fluid center">
|
||||
<div className="col-md-5">
|
||||
|
||||
|
||||
<Carousel images={this.state.images}
|
||||
selected={this.state.currentImage}
|
||||
onClickLeft={this.onClickLeft}
|
||||
onClickRight={this.onClickRight}
|
||||
onSelectImage={this.onSelectImage} />
|
||||
<div className="col-md-5">
|
||||
<Carousel images={this.state.images}
|
||||
selected={this.state.currentImage}
|
||||
onClickLeft={this.onClickLeft}
|
||||
onClickRight={this.onClickRight}
|
||||
onSelectImage={this.onSelectImage} />
|
||||
|
||||
</div>
|
||||
<div className="col-md-7">
|
||||
<h3> {this.state.item.get('name')} </h3>
|
||||
<div>
|
||||
<div className='h4'> {this.state.item.get('list_price')} KM</div>
|
||||
<div className='h5'>{this.state.item.get('pricePerUnit')}</div>
|
||||
</div>
|
||||
|
||||
<div className="col-md-7">
|
||||
<h3> {this.state.item.get('name')}</h3>
|
||||
<div>
|
||||
<div className='h4'> {this.state.item.get('list_price')} KM</div>
|
||||
<div className='h5'>{this.state.item.get('pricePerUnit')}</div>
|
||||
<div> {this.state.item.get('description')}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div> {this.state.item.get('description')}</div>
|
||||
</div>
|
||||
|
||||
quantitative descriptions
|
||||
</div>
|
||||
<Traits traits={this.state.item.get('traits')} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -50,6 +45,11 @@ var ItemWithDetailsPage = React.createClass({
|
||||
ItemDetailsActions.loadItemWithDetails();
|
||||
},
|
||||
|
||||
componentWillUnmount: function () {
|
||||
ItemDetailsStore.removeChangeListener(this._onChange);
|
||||
NavigationStore.removeChangeListener(this._onChange);
|
||||
},
|
||||
|
||||
|
||||
onClickLeft: function() {
|
||||
ItemDetailsActions.previousCarouselImage();
|
||||
|
||||
27
front-ui/app/components/items/traits.js
Normal file
27
front-ui/app/components/items/traits.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var React = require('react');
|
||||
|
||||
var Traits = React.createClass({
|
||||
render: function() {
|
||||
|
||||
var traitsPresentation = [];
|
||||
var traits = (this.props.traits || {});
|
||||
for(var traitKey in traits ) {
|
||||
if(traits.hasOwnProperty(traitKey)) {
|
||||
var traitValue = this.props.traits[traitKey];
|
||||
traitsPresentation.push( <div className="single_trait">{traitKey}: {traitValue}</div> );
|
||||
}
|
||||
}
|
||||
|
||||
console.log(traitsPresentation);
|
||||
return (
|
||||
<div className="row-fluid">
|
||||
<div className="span12">
|
||||
{traitsPresentation}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = Traits;
|
||||
@@ -7,6 +7,12 @@
|
||||
|
||||
}
|
||||
|
||||
.single_trait {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.single_item img {
|
||||
padding: 5px;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user