From 28a7a2f200270ea64c7169403d79244babf5595b Mon Sep 17 00:00:00 2001
From: khawerrind <khawer.zeshan@gmail.com>
Date: Fri, 30 Dec 2016 21:48:37 +0500
Subject: PLT-3132 Add a direct message link to the contact pop-over (#4853)

* added DM button to the user picture and name popover

* removed isRequired from status and busy properties from profile_popover.jsx
---
 webapp/components/user_profile.jsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'webapp/components/user_profile.jsx')

diff --git a/webapp/components/user_profile.jsx b/webapp/components/user_profile.jsx
index 807c5f023..d0267c0d8 100644
--- a/webapp/components/user_profile.jsx
+++ b/webapp/components/user_profile.jsx
@@ -10,6 +10,11 @@ import {OverlayTrigger} from 'react-bootstrap';
 import React from 'react';
 
 export default class UserProfile extends React.Component {
+    constructor(props) {
+        super(props);
+
+        this.hideProfilePopover = this.hideProfilePopover.bind(this);
+    }
     shouldComponentUpdate(nextProps) {
         if (!Utils.areObjectsEqual(nextProps.user, this.props.user)) {
             return true;
@@ -42,6 +47,10 @@ export default class UserProfile extends React.Component {
         return false;
     }
 
+    hideProfilePopover() {
+        this.refs.overlay.hide();
+    }
+
     render() {
         let name = '...';
         let profileImg = '';
@@ -60,6 +69,7 @@ export default class UserProfile extends React.Component {
 
         return (
             <OverlayTrigger
+                ref='overlay'
                 trigger='click'
                 placement='right'
                 rootClose={true}
@@ -69,6 +79,7 @@ export default class UserProfile extends React.Component {
                         src={profileImg}
                         status={this.props.status}
                         isBusy={this.props.isBusy}
+                        hide={this.hideProfilePopover}
                     />
                 }
             >
-- 
cgit v1.2.3-1-g7c22

