Created
December 2, 2016 11:53
-
-
Save fcsonline/496bb9babbbff7b16ccb9bad96901850 to your computer and use it in GitHub Desktop.
Cart - CartItem
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
class CartItem extends React.Component { | |
onClickRemove () { | |
// Go to your store and remove item | |
} | |
render() { | |
const { item } = this.props; | |
const isPremium = item.premium ? 'premium' : ''; | |
return ( | |
<div className={isPremium}> | |
<header>{item.title}</header> | |
<p>{item.description}</p> | |
<button onClick={this.onClickRemove}>Remove from cart</button> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment