server side for getting items from cart
This commit is contained in:
47
front-ui/app/components/cart/cartPage.js
Normal file
47
front-ui/app/components/cart/cartPage.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var React = require('react'),
|
||||
CartStore = require('../../stores/cartStore'),
|
||||
AddToCart = require('../cart/addToCart');
|
||||
|
||||
var Router = require('react-router');
|
||||
|
||||
|
||||
var ItemWithDetailsPage = React.createClass({
|
||||
|
||||
render: function() {
|
||||
|
||||
return (
|
||||
|
||||
<div className="cart-page row-fluid center">
|
||||
This is the cart page!
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
// Add change listeners to stores
|
||||
componentDidMount: function() {
|
||||
CartStore.addChangeListener(this._onChange);
|
||||
|
||||
},
|
||||
|
||||
componentWillUnmount: function () {
|
||||
CartStore.removeChangeListener(this._onChange);
|
||||
},
|
||||
|
||||
_onChange: function () {
|
||||
|
||||
if (this.isMounted()) {
|
||||
this.setState(ItemDetailsStore.getState());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
getInitialState: function () {
|
||||
return CartStore.getState();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = ItemWithDetailsPage;
|
||||
Reference in New Issue
Block a user