Commit 82d5bc4a authored by Dmytro Zavgorodniy's avatar Dmytro Zavgorodniy

[RNA-761] Set title for ItemDetailsHOC

parent 8524d128
......@@ -26,6 +26,7 @@ function enhanceItemDetails(Wine, Drink, AddToCartView) {
const AddToCartViewHOC = enhanceAddToCartView(AddToCartView)
class Wrapper extends Component {
static propTypes = {
title: PropTypes.string.isRequired,
itemType: PropTypes.oneOf(['wine', 'drink']).isRequired,
storeId: PropTypes.number,
user: PropTypes.object,
......@@ -48,6 +49,10 @@ function enhanceItemDetails(Wine, Drink, AddToCartView) {
drink: Drink,
}
componentWillMount() {
Router.setTitle(this.props.title)
}
shouldComponentUpdate(nextProps) {
return !isEqual(this.props, nextProps)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment