Last active
June 12, 2016 18:42
-
-
Save gCardinal/58dc23d3702d9bf8a4847599674c88bf to your computer and use it in GitHub Desktop.
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
import { connect } from 'react-redux' | |
import ProfilePicture from 'components/ProfilePicture' | |
import { changeProfilePicture } from '../actions' | |
export function mapStateToProps(state:any, ownProps:any):any | |
{ | |
return { | |
profilePictureUrl: state.user.profilePictureUrl, | |
} | |
} | |
export function mapDispatchToProps(dispatch:Function):any | |
{ | |
return { | |
onClick: () => dispatch(changeProfilePicture), | |
} | |
} | |
export default connect(mapStateToProps, mapDispatchToProps)(ConversationsList); |
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
import * as React from 'react' | |
export default class ConversationsList extends React.Component | |
{ | |
propTypes: { | |
profilePictureUrl: React.PropTypes.string.isRequired, | |
onClick: React.PropTypes.function.isRequired | |
} | |
render() { | |
let { profilePictureUrl, onClick } = this.props; | |
return ( | |
<div class="profile-picture" onClick={() => onClick()}> | |
<img src={profilePictureUrl} /> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment