Merge branch 'master' of https://github.com/senaduka/ribica
This commit is contained in:
40
front-ui/app/components/cart/addToCart.js
Normal file
40
front-ui/app/components/cart/addToCart.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
var React = require('react');
|
||||||
|
|
||||||
|
|
||||||
|
var AddToCart = React.createClass({
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<div className="row-fluid add-to-cart">
|
||||||
|
<div className="col-xs-offset-1 col-xs-1"><button className="btn btn-success">+</button></div>
|
||||||
|
<div className="col-xs-1"><button className="btn"> 2 </button></div>
|
||||||
|
<div className="col-xs-1"><button className="btn btn-success">-</button></div>
|
||||||
|
<div className="col-xs-8"><button className="btn btn-warning">U korpu</button></div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add change listeners to stores
|
||||||
|
componentDidMount: function() {
|
||||||
|
/*ItemActions.loadFrontPageItems();
|
||||||
|
ItemStore.addChangeListener(this._onChange); */
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
//items: ItemStore.getItems()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
_onChange: function () {
|
||||||
|
if (this.isMounted()) {
|
||||||
|
/* this.setState({
|
||||||
|
items: ItemStore.getItems()
|
||||||
|
}); */
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = AddToCart;
|
||||||
@@ -3,7 +3,8 @@ var React = require('react'),
|
|||||||
Traits = require('../items/traits'),
|
Traits = require('../items/traits'),
|
||||||
ItemDetailsActions = require('../../actions/itemDetailsActions'),
|
ItemDetailsActions = require('../../actions/itemDetailsActions'),
|
||||||
NavigationStore = require('../../stores/navigationStore'),
|
NavigationStore = require('../../stores/navigationStore'),
|
||||||
ItemDetailsStore = require('../../stores/itemDetailsStore');
|
ItemDetailsStore = require('../../stores/itemDetailsStore'),
|
||||||
|
AddToCart = require('../cart/addToCart');
|
||||||
|
|
||||||
var Router = require('react-router');
|
var Router = require('react-router');
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ var ItemWithDetailsPage = React.createClass({
|
|||||||
render: function() {
|
render: function() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<div className="item-with-details row-fluid center">
|
<div className="item-with-details row-fluid center">
|
||||||
<div className="col-md-5">
|
<div className="col-md-5">
|
||||||
<Carousel images={this.state.images}
|
<Carousel images={this.state.images}
|
||||||
@@ -20,6 +22,7 @@ var ItemWithDetailsPage = React.createClass({
|
|||||||
onClickLeft={this.onClickLeft}
|
onClickLeft={this.onClickLeft}
|
||||||
onClickRight={this.onClickRight}
|
onClickRight={this.onClickRight}
|
||||||
onSelectImage={this.onSelectImage} />
|
onSelectImage={this.onSelectImage} />
|
||||||
|
<AddToCart />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -32,6 +35,7 @@ var ItemWithDetailsPage = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Traits traits={this.state.item.get('traits')} />
|
<Traits traits={this.state.item.get('traits')} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ var SingleItem = React.createClass({
|
|||||||
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" } ;
|
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 (
|
return (
|
||||||
<div className="single_item" onClick={itemClick}>
|
<div className="single_item" onClick={itemClick}>
|
||||||
<img src={firstImage.url} />
|
<img src={firstImage.url} className="item_list_image" />
|
||||||
<h1> { this.props.item.get('name') }</h1>
|
<h1> { this.props.item.get('name') }</h1>
|
||||||
<div> { this.props.item.get('list_price') } KM </div>
|
<div> { this.props.item.get('list_price') } KM </div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
3
front-ui/app/css/cart.css
Normal file
3
front-ui/app/css/cart.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.add-to-cart {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
@@ -7,11 +7,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.single_trait {
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.single_item img {
|
.single_item img {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
@@ -25,5 +20,10 @@
|
|||||||
.single_item h1 {
|
.single_item h1 {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
text-decoration: bold;
|
text-decoration: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.single_trait {
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user