-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1e0ff6
commit 7e10342
Showing
7 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import * as types from '../constants/ActionTypes'; | ||
|
||
export const addToCart = productId => (dispatch, getState) => { | ||
dispatch({ | ||
type: types.ADD_TO_CART, | ||
productId, | ||
}); | ||
}; | ||
export const addToCart = productId => ({ | ||
type: types.ADD_TO_CART, | ||
productId, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import React, { PropTypes } from 'react'; | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import addToCart from '../actions'; | ||
|
||
import CurrencyConverter from '../lib/CurrencyConverter'; | ||
import Cart from '../components/Cart'; | ||
|
||
const CartContainer = ({ cart, addToCart }) => ( | ||
const CartContainer = ({ cart }) => ( | ||
<Cart | ||
cart={cart} | ||
currencyConverter={new CurrencyConverter(window.currencyConversions)} | ||
localCurrency={window.localCurrency} | ||
inventory={window.inventory} | ||
addToCart={productId => addToCart(productId)} | ||
/> | ||
); | ||
|
||
const mapStateToProps = state => ({ | ||
cart: state.cart, | ||
}); | ||
|
||
export default connect(mapStateToProps, { addToCart })(CartContainer); | ||
export default connect(mapStateToProps, {})(CartContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters