diff --git a/back-office/public/.DS_Store b/back-office/public/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/back-office/public/.DS_Store differ diff --git a/front-ui/app/.DS_Store b/front-ui/app/.DS_Store index 69e3a4e..5750456 100644 Binary files a/front-ui/app/.DS_Store and b/front-ui/app/.DS_Store differ diff --git a/front-ui/app/components/items/.DS_Store b/front-ui/app/components/items/.DS_Store index a9a49cb..1534571 100644 Binary files a/front-ui/app/components/items/.DS_Store and b/front-ui/app/components/items/.DS_Store differ diff --git a/front-ui/app/components/items/itemWithDetailsPage.js b/front-ui/app/components/items/itemWithDetailsPage.js index 85e558b..4af8846 100644 --- a/front-ui/app/components/items/itemWithDetailsPage.js +++ b/front-ui/app/components/items/itemWithDetailsPage.js @@ -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 ( - -
-
- - - +
+ -
-
-

{this.state.item.get('name')}

-
-
{this.state.item.get('list_price')} KM
-
{this.state.item.get('pricePerUnit')}
+
+
+

{this.state.item.get('name')}

+
+
{this.state.item.get('list_price')} KM
+
{this.state.item.get('pricePerUnit')}
+
{this.state.item.get('description')}
+
- -
{this.state.item.get('description')}
-
- - quantitative descriptions -
+ +
); @@ -50,6 +45,11 @@ var ItemWithDetailsPage = React.createClass({ ItemDetailsActions.loadItemWithDetails(); }, + componentWillUnmount: function () { + ItemDetailsStore.removeChangeListener(this._onChange); + NavigationStore.removeChangeListener(this._onChange); + }, + onClickLeft: function() { ItemDetailsActions.previousCarouselImage(); diff --git a/front-ui/app/components/items/traits.js b/front-ui/app/components/items/traits.js new file mode 100644 index 0000000..8d9d899 --- /dev/null +++ b/front-ui/app/components/items/traits.js @@ -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(
{traitKey}: {traitValue}
); + } + } + + console.log(traitsPresentation); + return ( +
+
+ {traitsPresentation} +
+
+ ); + } +}); + + +module.exports = Traits; diff --git a/front-ui/app/css/items.css b/front-ui/app/css/items.css index d1ab9f5..3842011 100644 --- a/front-ui/app/css/items.css +++ b/front-ui/app/css/items.css @@ -7,6 +7,12 @@ } +.single_trait { + display: inline-block; + text-align: center; + padding-right: 5px; +} + .single_item img { padding: 5px;