From 7484cc3f70ecb1067b78d8dc5374760c0ee4ff65 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 2 Feb 2017 18:29:33 +0000 Subject: [PATCH] Make default avatars clickable BaseAvatar can be passed an onClick which is called when it's, er, clicked, except when it was the default avatar in which case it merrily ignored it. Make it not ignore it. --- src/components/views/avatars/BaseAvatar.js | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/components/views/avatars/BaseAvatar.js b/src/components/views/avatars/BaseAvatar.js index 5862a9d4f1..456539b374 100644 --- a/src/components/views/avatars/BaseAvatar.js +++ b/src/components/views/avatars/BaseAvatar.js @@ -145,17 +145,33 @@ module.exports = React.createClass({ if (imageUrl === this.state.defaultImageUrl) { const initialLetter = this._getInitialLetter(name); - return ( - - - - - ); + if (onClick != null) { + return ( + + + + + ); + } else { + return ( + + + + + ); + } } if (onClick != null) { return (