Created
June 3, 2018 09:32
-
-
Save jamestthompson3/39f28c84bed7ad28fdf8738f1bbdba61 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const LikesList = ({ | |
user: { likes, user }, | |
updateFunctions: { addLike, deleteLike } | |
}) => ( | |
<Fragment> | |
<ListHeader> | |
<h3 style={{ margin: 0 }}>Likes</h3> | |
<i className="material-icons" style={{ cursor: 'pointer' }} > | |
add | |
</i> | |
</ListHeader> | |
<LikesContainer style={{ marginBottom: 20 }}> | |
{likes.map(like => ( | |
<ListItem open={isOpen} key={like.item + like.id}> | |
{like.item} | |
<i className="material-icons" onClick={() => deleteLike(user, like)}> | |
delete | |
</i> | |
</ListItem> | |
))} | |
</LikesContainer> | |
</Fragment> | |
) | |
const Likes = compose( | |
getContext({ updateFunctions: PropTypes.object, user: PropTypes.object }) | |
)(LikesList) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment