From 0695037f5f3f783e1944f151685ef86566e0579c Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 10 Nov 2016 17:30:35 +0000 Subject: [PATCH] pass in prop onClick by default --- src/components/views/avatars/MemberAvatar.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/avatars/MemberAvatar.js b/src/components/views/avatars/MemberAvatar.js index 68730ed3ea..7f9630d416 100644 --- a/src/components/views/avatars/MemberAvatar.js +++ b/src/components/views/avatars/MemberAvatar.js @@ -29,7 +29,9 @@ module.exports = React.createClass({ width: React.PropTypes.number, height: React.PropTypes.number, resizeMethod: React.PropTypes.string, - // Whether the onClick of the avatar should dispatch 'view_user' + // The onClick to give the avatar + onClick: React.PropTypes.function, + // Whether the onClick of the avatar should be overriden to dispatch 'view_user' viewUserOnClick: React.PropTypes.boolean, }, @@ -67,9 +69,8 @@ module.exports = React.createClass({ render: function() { var BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); - var {member, ...otherProps} = this.props; + var {member, onClick, ...otherProps} = this.props; - var onClick = null; if (this.props.viewUserOnClick) { onClick = () => { dispatcher.dispatch({