-
-
Save vasanthk/716090db1e712da1c5d0ddeb95ec01f0 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
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 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
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