48 lines
903 B
JavaScript
48 lines
903 B
JavaScript
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;
|